...
1#!/usr/bin/env bash
2
3# -e isnt set because buildozer returns 3 when nothing is changed successfully
4set -u
5
6
7echo "finding all kinds defined in '//hack/build/build-image:*' so we can tag them accordingly"
8kinds=$(bazel run --config=quiet //hack/tools:buildozer -- 'print kind' '//hack/build/build-image:*' |
9 sort |
10 uniq |
11 grep -v 'exports_files' |
12 grep -v 'package' |
13 grep -v 'shellcheck' |
14 tr '\n' ',' |
15 sed 's/,$//')
16
17echo "==="
18echo "kinds: $kinds"
19echo "==="
20echo "adding 'manual' tag to all targets with discovered kinds in '//hack/build/build-image:*'"
21echo "==="
22
23bazel run --config=quiet //hack/tools:buildozer -- \
24 -types="$kinds" \
25 'add tags "manual"' \
26 '//hack/build/build-image:*'
27
28echo "==="
29echo "adding 'manual' tag to all go_oci_image, container_image, and container_push targets throughout repo"
30echo "==="
31
32bazel run --config=quiet //hack/tools:buildozer -- \
33 -types="go_oci_image,container_image,container_pull" \
34 'add tags "manual"' \
35 '//...:*'
36
37ret="$?"
38if [[ "$ret" -ne 0 && "$ret" -ne 3 ]]; then
39 exit 1
40fi
41
42exit 0
View as plain text