mirror of
https://github.com/clearlinux/docs.git
synced 2026-09-06 22:01:33 +00:00
Add a link that shows off our image layer sharing
This commit is contained in:
@@ -20,17 +20,27 @@ fi
|
||||
repoDirs=()
|
||||
declare -A repoDirTags=()
|
||||
|
||||
latest=
|
||||
uniqImages=()
|
||||
for line in "${lines[@]}"; do
|
||||
tag="$(echo "$line" | awk -F ': +' '{ print $1 }')"
|
||||
if [ -z "$latest" -o "$tag" = 'latest' ]; then
|
||||
latest="$tag"
|
||||
fi
|
||||
repoDir="$(echo "$line" | awk -F ': +' '{ print $2 }')"
|
||||
if [ -z "${repoDirTags[$repoDir]}" ]; then
|
||||
repoDirs+=( "$repoDir" )
|
||||
uniqImages+=( "$repo:$tag" )
|
||||
else
|
||||
repoDirTags["$repoDir"]+=', '
|
||||
fi
|
||||
repoDirTags["$repoDir"]+='`'"$tag"'`'
|
||||
done
|
||||
|
||||
IFS=','
|
||||
imageLayers="https://imagelayers.io/?images=${uniqImages[*]}"
|
||||
unset IFS
|
||||
|
||||
for repoDir in "${repoDirs[@]}"; do
|
||||
if [[ "$repoDir" != *github.com* ]]; then
|
||||
# skip non-github.com for now
|
||||
@@ -60,3 +70,5 @@ for repoDir in "${repoDirs[@]}"; do
|
||||
done
|
||||
|
||||
echo
|
||||
echo "[]($imageLayers)"
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user