Merge pull request #10134 from ldoktor/ci-sort-range

ci.ocp: Sort images according to git
This commit is contained in:
Wainer Moschetta 2024-10-03 15:08:41 -03:00 committed by GitHub
commit b9025462fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,9 +16,12 @@ REPO="quay.io/kata-containers/kata-deploy-ci"
TAGS=$(skopeo list-tags "docker://$REPO") TAGS=$(skopeo list-tags "docker://$REPO")
# Only amd64 # Only amd64
TAGS=$(echo "$TAGS" | jq '.Tags' | jq "map(select(endswith(\"$ARCH\")))" | jq -r '.[]') TAGS=$(echo "$TAGS" | jq '.Tags' | jq "map(select(endswith(\"$ARCH\")))" | jq -r '.[]')
# Tags since $GOOD # Sort by git
TAGS=$(echo "$TAGS" | sed -n -e "/$GOOD/,$$p") SORTED=""
# Tags up to $BAD [ -n "$BAD" ] && LOG_ARGS="$GOOD~1..$BAD" || LOG_ARGS="$GOOD~1.."
[ -n "$BAD" ] && TAGS=$(echo "$TAGS" | sed "/$BAD/q") for TAG in $(git log --merges --pretty=format:%H --reverse $LOG_ARGS); do
[[ "$TAGS" =~ "$TAG" ]] && SORTED+="
kata-containers-$TAG-$ARCH"
done
# Comma separated tags with repo # Comma separated tags with repo
echo "$TAGS" | sed -e "s@^@$REPO:@" | paste -s -d, - echo "$SORTED" | tail -n +2 | sed -e "s@^@$REPO:@" | paste -s -d, -