-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
- Loading branch information
1 parent
f135e3f
commit cecb76d
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Run your command and capture its output | ||
output=$(make docker-list-all REGISTRY="$1" ORG="$2" TAG="$3") | ||
|
||
# Use a for loop to iterate over each line | ||
IFS=$'\n' # Set the Internal Field Separator to newline | ||
line_count=0 # Counter to keep track of the current line | ||
total_lines=$(echo "$output" | wc -l) # Get the total number of lines | ||
githubimageoutput=("multiarch_image" "amd64_image" "arm64_image" "s390x_image") | ||
githubdigestoutput=("multiarch_digest" "amd64_digest" "arm64_digest" "s390x_digest") | ||
|
||
for line in $output; do | ||
# Run the Docker command and get the digest | ||
digest=$(docker buildx imagetools inspect "$line" --format '{{json .}}' | jq -r .manifest.digest) | ||
|
||
# Add image name and digest to the output | ||
echo "${githubimageoutput[$line_count]}=$line" >> "$GITHUB_OUTPUT" | ||
echo "${githubdigestoutput[$line_count]}=$digest" >> "$GITHUB_OUTPUT" | ||
|
||
# Increment the line counter | ||
line_count=$((line_count + 1)) | ||
done |