diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 1f7b461b78..216a6e0ad4 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -20,6 +20,11 @@ export ACCEPTANCE_ARTIFACTS="$TEST_ARTIFACTS" echo "Create test artifacts: mkdir -p $TEST_ARTIFACTS" mkdir -p "$TEST_ARTIFACTS" +if [ -z ${BAZEL_REMOTE_S3_ACCESS_KEY_ID+x} ]; then + echo "S3 env not set, not starting bazel remote proxy" + exit 0 +fi + echo "Starting bazel remote cache proxy" # Start bazel remote cache proxy for S3 diff --git a/.buildkite/pipeline2.sh b/.buildkite/pipeline2.sh index 6d07c40091..4080a06981 100755 --- a/.buildkite/pipeline2.sh +++ b/.buildkite/pipeline2.sh @@ -13,6 +13,7 @@ gen_acceptance() { echo " key: ${name}_acceptance" echo " env:" echo " PYTHONPATH: \"python/:.\"" + echo " BAZELRC: .bazelrc_ci" echo " artifact_paths:" echo " - \"artifacts.out/**/*\"" echo " retry:" @@ -30,7 +31,7 @@ gen_bazel_acceptance() { name=${name#'//acceptance/'} echo " - label: \"Acceptance: $name\"" echo " command:" - echo " - bazel test $test" + echo " - bazel --bazelrc=.bazelrc_ci test $test" echo " key: ${name}_acceptance" echo " artifact_paths:" echo " - \"artifacts.out/**/*\"" diff --git a/Makefile b/Makefile index 1904b8be68..f8b7e1b668 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ BRACCEPT = bin/braccept GAZELLE_MODE?=fix +BAZELRC?=.bazelrc + all: bazel clean: @@ -30,7 +32,7 @@ go_deps.bzl: go.mod bazel: godeps gogen rm -f bin/* - bazel build //:scion //:scion-ci + bazel --bazelrc=${BAZELRC} build //:scion //:scion-ci tar -kxf bazel-bin/scion.tar -C bin tar -kxf bazel-bin/scion-ci.tar -C bin diff --git a/docker.sh b/docker.sh index 1786a16ddb..5440a8aa2f 100755 --- a/docker.sh +++ b/docker.sh @@ -34,7 +34,7 @@ cmd_build() { cmd_tester() { set -eo pipefail - bazel run //docker/testimages:scion_testing_bundle + bazel --bazelrc=${BAZELRC:-.bazelrc} run //docker/testimages:scion_testing_bundle docker build -f "docker/testimages/Dockerfile.sig_accept" -t "scion_sig_acceptance" docker/testimages } diff --git a/docker/perapp/build-images.sh b/docker/perapp/build-images.sh index 7c04d6b636..53ee522f49 100755 --- a/docker/perapp/build-images.sh +++ b/docker/perapp/build-images.sh @@ -11,7 +11,7 @@ STAGE=${1:-prod} # Build the binaries. # This will fetch everything that haven't been fetched yet. -bazel build //:scion +bazel --bazelrc="$ROOTDIR/${BAZELRC:-.bazelrc}" build //:scion # Collect the licenses from the bazel cache. pushd $ROOTDIR/bazel-scion*/external @@ -23,7 +23,7 @@ tar cf $ROOTDIR/docker/perapp/licenses.tar -C $TMPDIR --transform 's,^,licenses/ rm -rf $TMPDIR # Build the images and push them to local docker repository. -bazel run //docker/perapp:$STAGE +bazel --bazelrc="$ROOTDIR/${BAZELRC:-.bazelrc}" run //docker/perapp:$STAGE # Remove licenses tar cvf $ROOTDIR/docker/perapp/licenses.tar --files-from /dev/null