Use a staging area for storing builder image branch builds
Currently, whenever I have to change something in the builder images, my workflow is
- Make the change in
gitlab-omnibus-builder
repo. - Push that change to
master
branch in my fork ofgitlab-omnibus-builder
, so the image gets built and pushed to registry of my fork. - Modify .gitlab-ci.yml file in
omnibus-gitlab
to change all references ofdev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder
to registry my fork. - Build packages to check if everything is working.
- Revert the change made to .gitlab-ci.yml
The process would be easier if we could use a staging area in gitlab-omnibus-builder
registry itself.
Proposal
- Have branch build push the tag to
registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/staging
. - Since we rarely have multiple MRs happening simultaneously in that repo, have the branch builds use
latest
tag, and overwrite earlier versions. For example, a new branch build will push the following Ubuntu 16.04 image:registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/staging/ubuntu_16.04:latest
. This will overwrite existinglatest
tag. - In omnibus-gitlab's .gitlab-ci.yml, use an environment variable
BUILDER_IMAGE_REGISTRY
to point to the registry to use. The default value should bedev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder
New workflow
- Push new branch to
gitlab-omnibus-builder
repo - Trigger package builds, passing in
BUILDER_IMAGE_REGISTRY
as a trigger variable.
Advantages
- Take out my fork from the workflow
- No additional storage expenses - only the location changes. In both workflows, the image is being pushed to registry - earlier it was my fork's registry, now it becomes official repo's registry.
- Branch builds don't use new tags - just rewrite
latest
tag.
@marin WDYT about this?