I'm trying to build a CI pipeline with drone.io.
The steps are:
- Build a docker image
- Tag the docker image with the drone_build_number
- Deploy the image to the staging environment, "ECS, please deploy
myimage:drone_build_number
"
The deployment triggers some tests in the staging environment. If these pass, the drone.io's deployment hook is called: http://mydronehost/builds/123?fork=true&event=deployment&deploy_to=prod
. This should deploy myimage:drone_build_number
to prod, where build_number
was 123 in this case. Instead, the build gets a new number, e.g. 124, and the deployment fails, since myimage:124
does not exist.
Is it possible to somehow access the "parent" build-number (123) in this context?
Why not tag the image with the git commit SHA so it'll be consistent between repeated builds of the same release and across environments?