Fixed deployment of production image

parent dd9be94a
Pipeline #63088613 failed with stages
in 2 minutes and 25 seconds
......@@ -78,18 +78,26 @@ services:
}
deploy_image() {
BRANCH="$CI_COMMIT_REF_NAME"
IMAGE_VERSION=`docker image inspect \
--format '{{ index .Config.Labels "org.label-schema.version" }}' \
"${CI_REGISTRY_IMAGE}/$BRANCH"`
if [[ ! -z $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ]]; then
BRANCH="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
IMAGE_VERSION="latest"
docker image load --input "${BRANCH}-image.tar.gz"
else
BRANCH="$CI_COMMIT_REF_NAME"
docker image load --input "${BRANCH}-image.tar.gz"
IMAGE_VERSION=`docker image inspect \
--format '{{ index .Config.Labels "org.label-schema.version" }}' \
"${CI_REGISTRY_IMAGE}/$BRANCH"`
fi
docker image load --input "${BRANCH}-image.tar.gz"
IMAGE_VERSION=`docker image inspect \
--format '{{ index .Config.Labels "org.label-schema.version" }}' \
"${CI_REGISTRY_IMAGE}/$BRANCH"`
docker image tag \
"${CI_REGISTRY_IMAGE}/$BRANCH" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment