January 2019
Intermediate to advanced
484 pages
11h 48m
English
This block is executed only if the previous stage ends without any error. Once the block is executed, we are ready to publish our image:
docker login -u ${CI_ENV_REGISTRY_USER} -p "${CI_ENV_REGISTRY_PASS}"
if [[ ${TRAVIS_TAG} =~ ^v.*$ ]]; then docker tag my-app ${RELEASE_IMAGE_PATH} docker push ${RELEASE_IMAGE_PATH}else docker tag my-app ${BUILD_IMAGE_PATH} docker push ${BUILD_IMAGE_PATH}fi
Our image tag uses the commit hash for ordinary builds and uses a manually tagged version for releases. There's no absolute rule for tagging an image, but using the default latest tag for your business service is strongly discouraged as it could result in version confusion, such as running two different images that have the same name. The ...
Read now
Unlock full access