Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-autograde
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CS-107
moodle-autograde
Merge requests
!145
Fix failures in running jobs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Fix failures in running jobs
ds/gitlab-ci
into
master
Overview
7
Commits
18
Pipelines
36
Changes
1
Open
Dixit Sabharwal
requested to merge
ds/gitlab-ci
into
master
1 year ago
Overview
7
Commits
18
Pipelines
36
Changes
1
Expand
Update jobs to only run if the previous stage succeeds.
0
0
Merge request reports
Viewing commit
209eb8da
Show latest version
1 file
+
8
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
209eb8da
Fix tag job in ci
· 209eb8da
Dixit Sabharwal
authored
1 year ago
.gitlab-ci/tag/git-tag-image.yaml
+
8
−
6
Options
@@ -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