Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use "production" floating tag when uilding docker image from version …
…git tags
  • Loading branch information
svyatonik committed Dec 24, 2021
commit fb7708804d137427b5ae6d8938adb1d48125ec0c
13 changes: 10 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ default:
when:
- runner_system_failure
- unknown_failure
- api_failure
- api_failure
interruptible: true
tags:
- linux-docker
Expand Down Expand Up @@ -240,7 +240,14 @@ build-nightly:
elif [[ "${CI_COMMIT_REF_NAME}" ]]; then
VERSION=$(echo ${CI_COMMIT_REF_NAME} | sed -r 's#/+#-#g');
fi
- echo "Effective tags = ${VERSION} sha-${CI_COMMIT_SHORT_SHA} latest"
# When building from version tags (v1.0, v2.1rc1, ...) we'll use "production" to tag
# docker image. In all other cases, it'll be "latest".
- if [[ $CI_COMMIT_REF_NAME =~ ^v[0-9]+\.[0-9]+.*$ ]]; then
FLOATING_TAG="production";
else
FLOATING_TAG="latest";
fi
- echo "Effective tags = ${VERSION} sha-${CI_COMMIT_SHORT_SHA} ${FLOATING_TAG}"
secrets:
DOCKER_HUB_USER:
vault: cicd/gitlab/parity/DOCKER_HUB_USER@kv
Expand All @@ -260,7 +267,7 @@ build-nightly:
--build-arg VERSION="${VERSION}"
--tag "${IMAGE_NAME}:${VERSION}"
--tag "${IMAGE_NAME}:sha-${CI_COMMIT_SHORT_SHA}"
--tag "${IMAGE_NAME}:latest"
--tag "${IMAGE_NAME}:${FLOATING_TAG}"
--file "${DOCKERFILE}" .
# The job will success only on the protected branch
- echo "${DOCKER_HUB_PASS}" |
Expand Down