0

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?

Rendijs S
  • 365
  • 1
  • 3
  • 12

2 Answers2

1

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?

Oliver
  • 11,857
  • 2
  • 36
  • 42
0

When you promote a build you can access the parent build number using the DRONE_BUILD_PARENT environment variable.

Brad Rydzewski
  • 2,523
  • 14
  • 18