Skip to content

Commit

Permalink
Briefer output for show-latest-build-versions.sh
Browse files Browse the repository at this point in the history
Set VERBOSE=1 to show the verbose output if you want it.
  • Loading branch information
simonbaird committed Jun 12, 2024
1 parent 70ce0cf commit 555e8a9
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions show-latest-build-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ RH_TITLE="Red Hat Build"
RH_REPO="registry.redhat.io/rhtas/ec-rhel9"
RH_TAGS="${1:-"0.2 0.4 latest"}"

VERBOSE="${VERBOSE:-""}"

UPSTREAM_TITLE="Upstream Build"
UPSTREAM_REPO="quay.io/enterprise-contract/ec-cli"
UPSTREAM_TAG="snapshot"
Expand All @@ -17,35 +19,45 @@ _show_details() {
local ref="$2"

# Make sure we have the latest
podman pull --quiet $ref
podman pull --quiet $ref >/dev/null

# Get the digest
local digest="$(skopeo inspect "docker://$ref" | jq -r .Digest)"

echo ""
echo $title
echo $title | tr '[:print:]' '-'
if [ "$VERBOSE" = "1" ]; then
# Verbose output
echo ""
echo $title
echo $title | tr '[:print:]' '-'

echo Ref:
echo " $ref"

echo Pinned ref:
echo " $ref@$digest"

echo Ref:
echo " $ref"
echo Version:
podman run --rm "$ref@$digest" version | sed 's/^/ /'

echo Pinned ref:
echo " $ref@$digest"
echo Binaries in /usr/local/bin:
podman run --rm --entrypoint /bin/bash "$ref@$digest" -c 'ls -l /usr/local/bin' | sed 's/^/ /'

echo Version:
podman run --rm "$ref@$digest" version | sed 's/^/ /'
echo Command for poking around:
echo " podman run --rm -it --entrypoint /bin/bash $ref"

echo Binaries in /usr/local/bin:
podman run --rm --entrypoint /bin/bash "$ref@$digest" -c 'ls -l /usr/local/bin' | sed 's/^/ /'
echo ""

echo Command for poking around:
echo " podman run --rm -it --entrypoint /bin/bash $ref"
else
# Brief output
echo "$ref@$digest"
podman run --rm "$ref@$digest" version | sed 's/^/ /' | head -3
echo ""

echo ""
fi
}

for t in ${RH_TAGS}; do
_show_details "$RH_TITLE" "$RH_REPO:$t"
_show_details "$RH_TITLE ($t)" "$RH_REPO:$t"
done

_show_details "$UPSTREAM_TITLE" "$UPSTREAM_REPO:$UPSTREAM_TAG"

0 comments on commit 555e8a9

Please sign in to comment.