Skip to content

Instantly share code, notes, and snippets.

@nickboldt
Last active August 8, 2025 20:02
Show Gist options
  • Save nickboldt/9203601e65e2c53a2736264709dad3d7 to your computer and use it in GitHub Desktop.
Save nickboldt/9203601e65e2c53a2736264709dad3d7 to your computer and use it in GitHub Desktop.
get list of published plugins based on plugin_builds/ folder content
#!/bin/bash
SCRIPT_DIR=$(cd "$(dirname "$0")" || exit; pwd)
ROOT_DIR=$(cd "$SCRIPT_DIR"/../../ || exit; pwd)
SHOW_FOUND=0
norm="\033[0;39m"
green="\033[1;32m"
blue="\033[1;34m"
red="\033[1;31m"
usage () {
echo "
List discoverable OCI artifacts for the plugin_builds/ folder
Usage:
$0
Options:
--show-found show also the found images, not just the warnings and errors
Examples:
$0 --show-found
To trigger 1 or more individual plugin builds, see $ROOT_DIR/.tekton/generatePipelineRunsForPlugins.sh
";
}
# commandline args
while [[ "$#" -gt 0 ]]; do
case $1 in
'-h'|'--help') usage; exit;;
'--show-found') SHOW_FOUND=$2; shift 2;;
*) echo "[ERROR] Invalid parameter: $1"; echo; usage; exit;;
esac
done
i=0; c=0
while IFS= read -r -d '' d; do
(( c++ ))
done < <(find "$ROOT_DIR/plugin_builds/" -name "*json" -print0)
while IFS= read -r -d '' d; do
(( i++ ))
# echo -e "\n$d";
img=$(jq -r '.[][].registryReference' $d)
if [[ $img ]]; then
FAIL=$(skopeo inspect docker://$img --raw 2>&1 | grep "not found");
if [[ $FAIL ]]; then
echo -e "[$i/$c] ${red}[!] $img NOT FOUND!${norm}"
else
if [[ $SHOW_FOUND -eq 1 ]]; then
echo -e "[$i/$c] ${green}[/] $img ${norm}"
fi
fi
else
echo -e "[$i/$c] ${blue}[?] $d - no registryReference to check!${norm}"
fi
done < <(find "$ROOT_DIR/plugin_builds/" -name "*json" -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment