#!/usr/bin/env bash # -e isnt set because buildozer returns 3 when nothing is changed successfully set -u echo "finding all kinds defined in '//hack/build/build-image:*' so we can tag them accordingly" kinds=$(bazel run --config=quiet //hack/tools:buildozer -- 'print kind' '//hack/build/build-image:*' | sort | uniq | grep -v 'exports_files' | grep -v 'package' | grep -v 'shellcheck' | tr '\n' ',' | sed 's/,$//') echo "===" echo "kinds: $kinds" echo "===" echo "adding 'manual' tag to all targets with discovered kinds in '//hack/build/build-image:*'" echo "===" bazel run --config=quiet //hack/tools:buildozer -- \ -types="$kinds" \ 'add tags "manual"' \ '//hack/build/build-image:*' echo "===" echo "adding 'manual' tag to all go_oci_image, container_image, and container_push targets throughout repo" echo "===" bazel run --config=quiet //hack/tools:buildozer -- \ -types="go_oci_image,container_image,container_pull" \ 'add tags "manual"' \ '//...:*' ret="$?" if [[ "$ret" -ne 0 && "$ret" -ne 3 ]]; then exit 1 fi exit 0