mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
ebe5fe2a02
* Update BUILD.bazel * Update check_gazelle.sh * Update check_gazelle.sh * Update check_visibility.sh * Revert "Update BUILD.bazel" This reverts commit 8d631fc49af38268e16d622a2002bea040a08d37. * remove travis slow bazel builds * Add buildkite build status
30 lines
841 B
Bash
Executable File
30 lines
841 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Continous Integration script to check that BUILD.bazel files have the correct
|
|
# visibility.
|
|
|
|
# Protected packages are:
|
|
# //beacon-chain/...
|
|
# //validator/...
|
|
|
|
# Duplicate redirect 5 to stdout so that it can be captured, but still printed
|
|
# nicely.
|
|
exec 5>&1
|
|
|
|
# Run gazelle while piping a copy of the output to stdout via 5.
|
|
changes=$(
|
|
bazel --bazelrc=.buildkite-bazelrc query 'visible(//... except (//beacon-chain/... union //validator/...), (//beacon-chain/... union //validator/...))' | tee >(cat - >&5)
|
|
)
|
|
|
|
# If the captured stdout is not empty then targets are exposed!
|
|
if [ -z "$changes" ]
|
|
then
|
|
echo "OK: Visibility is good."
|
|
exit 0
|
|
else
|
|
echo "FAIL: The above targets belong to protected packages and the targets \
|
|
are visible outside of their package!"
|
|
echo "Please reduce the target visibility."
|
|
exit 1
|
|
fi
|