build: no longer use bazel from "ngcontainer" image

We no longer use Bazel from the `ngcontainer` image as it is
no longer maintained and we need to use the latest version of
Bazel in CircleCI. It's not ideal to use Bazel through Yarn since
binaries like that should be actually part of the docker image, but
for now we need to do this for jobs that use NodeJS & Bazel at the same time.
This is similar to what `angulart/angular` does.
This commit is contained in:
Paul Gschwendtner
2019-06-19 10:21:31 +02:00
committed by Jeremy Elbourn
parent f6d4acb44a
commit 2ce5ffd56b
5 changed files with 75 additions and 69 deletions
@@ -7,13 +7,13 @@ if [[ -z "${GCP_DECRYPT_TOKEN}" ]]; then
fi
# Decode the GCP token that is needed to authenticate the Bazel remote execution.
openssl aes-256-cbc -d -in .circleci/gcp_token -k ${GCP_DECRYPT_TOKEN} \
-out /home/circleci/.gcp_credentials
openssl aes-256-cbc -d -in .circleci/gcp_token -md md5 -k ${GCP_DECRYPT_TOKEN} \
-out /home/.gcp_credentials
# Export the "GOOGLE_APPLICATION_CREDENTIALS" variable that should refer to the GCP credentials
# file. Bazel automatically picks up the credentials from that variable.
# https://github.com/bazelbuild/bazel/blob/master/third_party/grpc/include/grpc/grpc_security.h#L134-L137
echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/circleci/.gcp_credentials" >> $BASH_ENV
echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/.gcp_credentials" >> $BASH_ENV
# Update the global Bazel configuration to always use remote execution.
sudo bash -c "echo 'build --config=remote' >> /etc/bazel.bazelrc"
# Update the CircleCI Bazel configuration to always use remote execution.
echo 'build --config=remote' >> .circleci/bazel.rc