Use Duplo to update a service's container from Gitlab CI/CD
Update the docker image for a service
The goal of this section is to show how you can update the docker image for a service, after you have built that image.
Example Workflow
This example makes some assumptions:
Your workflow already has a build job - we created one in the previous section
deploy:stage:deployimage:name:duplocloud/duploctl:v0.2.27entrypoint: [""]# this will have DUPLO_HOST and DUPLO_TOKENenvironment:name:$TIER/$DUPLO_TENANTurl:${MYAPPS_URL}rules:# run when a new tag is pushed - if:$CI_COMMIT_TAG && $CI_PIPELINE_SOURCE == "pipeline"when:alwaysvariables:# build your image hereCI_IMAGE:${IMAGE_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_TAG}GIT_STRATEGY:none# no need to pull the reponeeds: - job:publish_imageoptional:truebefore_script: - echo "Updating service ${CI_PROJECT_NAME} with image ${CI_IMAGE}"script:duploctl service update_image $CI_PROJECT_NAME $CI_IMAGE