I am using Gitlab for CI/CD and using Artifactory as animage repository. I am trying to get a better understanding of how to correctly use the Jfrog CLI and Artifactory (AF) to create a build and update it through the project's environment promotion.
These are the current steps I'm taking for pushing the images to AF. For example I am using "myproj" for the build name and "1234" for the build number.
dev:
- docker build :dev-1234
- jfrog rt docker push
- jfrog rt bce
- jfrog rt bag
- jfrog rt bp
staging:
- jfrog docker pull
- docker tag :staging-1234
- jfrog rt docker push
- jfrog rt bp
- jfrog rt build-promote --status=staging
prod:
- jfrog docker pull
- docker tag :prod-1234
- jfrog rt docker push
- docker tag :latest
- jfrog rt docker push
- jfrog rt bp
- jfrog rt build-promote --status=prod
At the end I have 3 builds within AF and each build contains :latest :prod-1234 :staging-1234
What I'd like to do is have 1 build that contains all 4 images. If I remove the build-publish command I can retain a single AF build that has updated status through each stage. However, at the end of the pipeline it is showing a status=prod while only referencing the :dev image. All 4 images are being created and stored in the expected repo so I know they're at least making it into AF.
Am I misunderstanding what the intent is behind AF builds? Or is this user error?
If I understand your question correctly, you want to have 1 build that references all your (4) docker images, but instead you have 3 builds that references 3 separate docker images. It is a bit difficult to understand your point without
code formattingtext.JFrog CLI works in the way that, as soon as you specify
--build-nameand--build-numberarguments to any command, it will start to collect build information.This build information exists as a JSON file in a temporary directory while you are collecting build info.
Any subsequent commands that specify the
--build-nameand--build-numberarguments will append to the existing, temporary, build info.The temporary build info JSON file will be deleted, when:
jf rt bpcommand.So you can do three things:
jf rt build-appendcommand. This command will create a "master" build that references all appended builds.Build promotion has many oversights and issues. (for example you can't promote aggregated build info). Release Bundles V2 seems to solve many of the shortcomings of Build Promotion.
I hope this helps you out.