Skip to content
Snippets Groups Projects

Fix failures in running jobs

Open Dixit Sabharwal requested to merge ds/gitlab-ci into master
1 file
+ 8
6
Compare changes
  • Side-by-side
  • Inline
@@ -11,14 +11,16 @@ git_tag_image:
- echo "Tagging the Docker images with the Git tag version ..."
- export GIT_TAG_VERSION=$(echo "$CI_COMMIT_TAG" | sed 's/^release\///') # Extract version from Git tag
# Split the newline-separated string into an array
- IFS=$'\n' read -d '' -a image_names <<< "$DOCKER_IMAGE_NAMES"
# Remove the trailing newline from DOCKER_IMAGE_NAMES
- export DOCKER_IMAGE_NAMES=$(echo "$DOCKER_IMAGE_NAMES" | sed -e '$ ! s/$/ /' -e '$ s/$/\n/')
# Loop through the array and tag and push each image
# Loop over newline separated list of Docker image names
# and tag and push each image
- |
for image_name in "${image_names[@]}"; do
docker tag "$image_name:$COMMIT_SHA_SHORT" "$image_name:$GIT_TAG_VERSION"
docker push "$image_name:$GIT_TAG_VERSION"
echo "$DOCKER_IMAGE_NAMES" | while read -r image_name; do
echo "Tagging $image_name:$COMMIT_SHA_SHORT with $image_name:$GIT_TAG_VERSION ..."
docker tag $image_name:$COMMIT_SHA_SHORT $image_name:$GIT_TAG_VERSION # Tag the image with the Git tag version
docker push $image_name:$GIT_TAG_VERSION # Push the Git tag version tagged image
done
rules:
- !reference [.check_tag, rules]
Loading