Docker image reuse between review app and production

I’m trying to figure out how to fit the Jfrog https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-PromoteDockerImage functionality into a GItlab CI pipeline with a Kubernetes runner.

I currently have
stages:

  • test
  • build
  • release
  • review
  • deploy

and

test:
stage: test

compile:
stage: build

image_build:
stage: release

deploy_review:
stage: review
only:
- branches
except:
- tags

deploy_live:
stage: deploy
only:
- tags
when: manual

How would I change to use the " Promote Docker Image" model such that once the review is done the image used there is the one that is promoted to the “live” environment rather than being rebuilt?
Thanks!

Is it really the image that you want to reuse or do you just want to pass the binary build from one job to another? If it’s the former, just say image: myimagename in your deploy_live job (any job can have an image key). If it’s the former, then you probably need job artefacts.

Good luck!

Sarah

1 Like