prysm-pulse/scripts/check_gazelle.sh
Preston Van Loon ebe5fe2a02
Moving slow tasks from Travis to Buildkite (#621)
* 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
2018-10-03 21:16:44 -04:00

23 lines
635 B
Bash
Executable File

#!/bin/bash
# Continous Integration script to check that BUILD.bazel files are as expected
# when generated from gazelle.
# 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 run //:gazelle -- fix --mode=diff | tee >(cat - >&5))
# If the captured stdout is not empty then Gazelle has diffs.
if [ -z "$changes" ]
then
echo "OK: Gazelle does not need to be run"
exit 0
else
echo "FAIL: Gazelle needs to be run"
echo "Please run bazel run //:gazelle -- fix"
exit 1
fi