diff --git a/README.md b/README.md index cc0e7b0..9256103 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,9 @@ jobs: - your compose files must be on your repo root. - your compose files must match '\*compose\*.yaml' or '\*compose\*.yml' - your images in compose files must include the full registry: - - docker.io/somecompany/theimage:x.x.x - - mcr.microsoft.com/part/theimage:x.x.x + - `docker.io/somecompany/theimage:x.x.x` (ie, docker.io/grafana/grafana:10.0.1) + - `mcr.microsoft.com/part/theimage:x.x.x` (ie, mcr.microsoft.com/azure-cli:2.50.0) + - `gcr.io/project/image:x.x.x` (ie, gcr.io/cadvisor/cadvisor:v0.47.1) ## what for: @@ -63,6 +64,7 @@ jobs: - dockerhub - microsoft mcr +- google gcr - other? open an issue or open pr ## what does it look like diff --git a/VERSION b/VERSION index 9ff151c..a1c2c6a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.1.0 \ No newline at end of file +v0.1.1 \ No newline at end of file diff --git a/bin/pincher.sh b/bin/pincher.sh index 4e1f419..fbf3f1f 100755 --- a/bin/pincher.sh +++ b/bin/pincher.sh @@ -109,6 +109,23 @@ do [ -n "$latest_version_in_registry" ] && versions_magic done +# google gcr +versions_gcr=$(yq '.services[].image' ./*compose*.y* | grep gcr.io | sort | uniq) +for version in $versions_gcr +do + latest_version_in_registry="" + + [[ $version =~ gcr.io\/(.*)\:(.*) ]] + image=${BASH_REMATCH[1]} + v_rematched=${BASH_REMATCH[2]} + echo "image: $image, v: $v_rematched" + + latest_version_in_registry="$(curl -s https://gcr.io/v2/$image/tags/list | jq -r '.tags[]' | sort -V -t. -k1,1 -k2,2 -k3,3 | grep -oP '^v?[0-9]+\.[0-9]+\.[0-9]+$' | tail -n 1)" + + # the magic + [ -n "$latest_version_in_registry" ] && versions_magic +done + # considerations "how to edit/contribute" # add each new registry in a separated block loop as per the existing ones # authentication happens via env_vars in the action block if required