From 6c6a9fba173eb343a383e6d22261b4507d46edaf Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Sat, 11 Jan 2025 00:35:57 +0000 Subject: [PATCH] Fix issue with go_missing_licenses.json bazel command Signed-off-by: Dom Del Nano --- ci/cloud_build_release.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci/cloud_build_release.sh b/ci/cloud_build_release.sh index 69b32c7fe5b..0680db321da 100755 --- a/ci/cloud_build_release.sh +++ b/ci/cloud_build_release.sh @@ -36,10 +36,11 @@ fi echo "The image tag is: ${release_tag}" image_repo="gcr.io/pixie-oss/pixie-prod" -all_licenses_opts=("//tools/licenses:all_licenses" "--config=stamp" "--action_env=GOOGLE_APPLICATION_CREDENTIALS" "--remote_download_outputs=toplevel") -all_licenses_path="$(bazel cquery "//tools/licenses:go_licenses" --output starlark --starlark:expr "target.files.to_list()[0].path" 2> /dev/null)" -deps_missing_licenses_path="$(bazel cquery "//tools/licenses:deps_licenses" --output starlark --starlark:expr "[f.path for f in target.files.to_list() if f.basename == 'deps_licenses_missing.json'][0]" 2> /dev/null)" -go_missing_licenses_path="$(bazel cquery "${all_licenses_opts[@]}" --output starlark --starlark:expr "[f.path for f in target.files.to_list() if f.basename == 'go_licenses_missing.json'][0]" 2> /dev/null)" +shared_opts=("--config=stamp" "--action_env=GOOGLE_APPLICATION_CREDENTIALS" "--remote_download_outputs=toplevel") +all_licenses_opts=("//tools/licenses:all_licenses" "${shared_opts[@]}") +all_licenses_path="$(bazel cquery "${all_licenses_opts[@]}" --output starlark --starlark:expr "target.files.to_list()[0].path" 2> /dev/null)" +deps_missing_licenses_path="$(bazel cquery "//tools/licenses:deps_licenses" "${shared_opts[@]}" --output starlark --starlark:expr "[f.path for f in target.files.to_list() if f.basename == 'deps_licenses_missing.json'][0]" 2> /dev/null)" +go_missing_licenses_path="$(bazel cquery "//tools/licenses:go_licenses" "${shared_opts[@]}" --output starlark --starlark:expr "[f.path for f in target.files.to_list() if f.basename == 'go_licenses_missing.json'][0]" 2> /dev/null)" print_missing_licenses() { cat "${deps_missing_licenses_path}" || true