Re: Suggestions for making private packages?

From: Pat Maddox <pat_at_patmaddox.com>
Date: Thu, 12 May 2022 23:12:49 UTC
On 11 Apr 2022, at 23:58, Pat Maddox wrote:

> We are considering using FreeBSD to deploy the proprietary software we 
> build.
>
> I am interested in using the package system to build and distribute 
> the software to our servers. I believe this will help us maintain 
> consistency and cleanliness.
>
> Right now I have a few ideas of how to do this:
>
> 1. Fork the ports tree, and add a directory for our software. Build as 
> usual.
> 2. Use portshaker to overlay our software onto the ports tree.
> 3. Use pkg-create directly.
>
> For those of you who write and deploy private software on FreeBSD, 
> what do you suggest?
>
> Thanks,
> Pat

I have made progress on this two different ways, using poudriere [1] and 
`pkg create` [2].

I’m not sure how to fit this into a CI / CD workflow. I want to build 
and deploy the latest version to staging, and then periodically promote 
that version to prod.

I don’t want to have to bump the port Makefile GH_TAGNAME with every 
commit that passes tests. Maybe that’s unavoidable? Porter’s 
handbook docs say “Using the name of a branch here is incorrect” for 
GH_TAGNAME [3].

How can I configure poudriere to build the latest version of our repo, 
as well as a version that we’ve designated for release? I think it 
makes sense to use the same build mechanism (i.e. poudriere) for 
everything, rather than using `pkg create` for bleeding edge builds and 
poudriere for releases.

Pat

[1] 
https://github.com/patmaddox/my-freebsd-ports/blob/main/devel/ex_ample/Makefile
[2] https://github.com/patmaddox/ex_ample/blob/main/Makefile
[3] 
https://docs.freebsd.org/en/books/porters-handbook/makefiles/#makefile-master_sites-github