Skip to content

Commit

Permalink
Fix issue with go_missing_licenses.json bazel command
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano committed Jan 11, 2025
1 parent 59d7b21 commit 6c6a9fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ci/cloud_build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c6a9fb

Please sign in to comment.