mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-01 08:56:32 +00:00
ci.ocp: Sort images according to git
The quay.io registry returns the tags sorted alphabetically and doesn't seem to provide a way to sort it by age. Let's use "git log" to get all changes between the commits and print all tags that were actually pushed. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
This commit is contained in:
@@ -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, -
|
||||||
|
Reference in New Issue
Block a user