diff --git a/show-latest-images.sh b/show-latest-images.sh index 2d361c8..207e497 100755 --- a/show-latest-images.sh +++ b/show-latest-images.sh @@ -3,20 +3,19 @@ ## This script prints out all the possible emqx-builder docker image tags built from the latest git tag GREP='grep --color=never' -ALL_SYS="$($GREP -A28 'platform:' .github/workflows/main.yaml | \ - $GREP -E '\-\s?\[.*\]$' | \ - tr -d '\- []"' | \ - sed -e '/^#.*/d' | \ - cut -d',' -f1 | \ +ALL_SYS="$($GREP -A28 'platforms=' .github/workflows/main.yaml | \ + $GREP -oE '{.*}' | \ + jq .os | \ + tr -d '"' | \ sort -u)" GIT_TAG="$(git describe --abbrev=0 --tags)" -OTP_VERSIONS="$($GREP -E "^\+\sOTP-.*" ./RELEASE.md | sed 's/\+\sOTP-//g')" -ELIXIR_VERSIONS="$($GREP -E "^\+\sElixir-.*" ./RELEASE.md | sed 's/\+\sElixir-//g')" -for elixir in $ELIXIR_VERSIONS; do - for otp in $OTP_VERSIONS; do - for sys in $ALL_SYS; do - echo "ghcr.io/emqx/emqx-builder/${GIT_TAG}:${elixir}-${otp}-${sys}" - done +OTP_ELIXIR_VERSIONS="$($GREP -oE "OTP-.*,Elixir.*" ./RELEASE.md)" +for line in $OTP_ELIXIR_VERSIONS; do + otp="$(echo "$line" | sed -n 's/.*OTP-\([^,]*\),.*/\1/p')" + elixir="$(echo "$line" | sed -n 's/.*Elixir-\([^,]*\)/\1/p')" + echo ">>>>>>>>>>>>>>> $line" + for sys in $ALL_SYS; do + echo "ghcr.io/emqx/emqx-builder/${GIT_TAG}:${elixir}-${otp}-${sys}" done done