Skip to content
Snippets Groups Projects
Verified Commit 8f2f3e09 authored by Konrad Botor's avatar Konrad Botor
Browse files

Fixed setting tag variable during Docker image build jobs

parent e2a1563c
No related branches found
No related tags found
1 merge request!2Templates based on HAfAH test jobs
Pipeline #58246 passed
...@@ -80,14 +80,13 @@ lint_python_scripts: ...@@ -80,14 +80,13 @@ lint_python_scripts:
echo -e "\e[0Ksection_end:$(date +%s):login\r\e[0K" echo -e "\e[0Ksection_end:$(date +%s):login\r\e[0K"
script: script:
- | - |
tag=""
echo -e "\e[0Ksection_start:$(date +%s):tag[collapsed=true]\r\e[0KDetermining tag for the new image..." echo -e "\e[0Ksection_start:$(date +%s):tag[collapsed=true]\r\e[0KDetermining tag for the new image..."
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
tag="latest" export tag="latest"
else else
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $CI_COMMIT_REF_SLUG" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $CI_COMMIT_REF_SLUG"
tag="$CI_COMMIT_REF_SLUG" export tag="$CI_COMMIT_REF_SLUG"
fi fi
echo -e "\e[0Ksection_end:$(date +%s):tag\r\e[0K" echo -e "\e[0Ksection_end:$(date +%s):tag\r\e[0K"
echo -e "\e[0Ksection_start:$(date +%s):build[collapsed=true]\r\e[0KBaking image "$CI_REGISTRY_IMAGE/$BUILD_TARGET${tag}"..." echo -e "\e[0Ksection_start:$(date +%s):build[collapsed=true]\r\e[0KBaking image "$CI_REGISTRY_IMAGE/$BUILD_TARGET${tag}"..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment