Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Circle CI docker version script when filtering tags #10539

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -336,20 +336,20 @@ jobs:
echo "Tags at commit:\n$tags_at_commit"

filtered_tags=$(echo "$tags_at_commit" | grep "^<<parameters.docker_name>>/" || true)
echo "Filtered tags:\n$filtered_tags"
echo "Filtered tags: $filtered_tags"

if [ -z "$filtered_tags" ]; then
export GIT_VERSION="untagged"
else
sorted_tags=$(echo "$filtered_tags" | sed "s/<<parameters.docker_name>>\///" | sort -V)
echo "Sorted tags:\n$sorted_tags"
echo "Sorted tags: $sorted_tags"

# prefer full release tag over "-rc" release candidate tag if both exist
full_release_tag=$(echo "$sorted_tags" | grep -v -- "-rc" || true)
if [ -z "$full_release_tag" ]; then
export GIT_VERSION=$(echo "$sorted_tags" | tail -n 1)
else
export GIT_VERSION=$(echo "$full_release_tag")
export GIT_VERSION=$(echo "$full_release_tag" | tail -n 1)
fi
fi