Skip to content

Commit

Permalink
Install bazel in staging build
Browse files Browse the repository at this point in the history
A little inefficient, but means that we can control our bazel version
and not rely on the upstream image.
  • Loading branch information
justinsb committed Mar 28, 2021
1 parent d8e473a commit 194b29e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev/staging/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ steps:
- DOCKER_REGISTRY=$_DOCKER_REGISTRY
- DOCKER_IMAGE_PREFIX=$_DOCKER_IMAGE_PREFIX
- ARTIFACT_LOCATION=$_ARTIFACT_LOCATION
- INSTALL_BAZELISK=y
entrypoint: dev/staging/push.sh
substitutions:
_GIT_TAG: 'dev'
Expand Down
9 changes: 9 additions & 0 deletions dev/staging/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ if [[ -z "${ARTIFACT_LOCATION:-}" ]]; then
exit 1
fi

if [[ -n "${INSTALL_BAZELISK:-}" ]]; then
DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.7.2/bazelisk-linux-amd64"
echo "Downloading bazelisk from $DOWNLOAD_URL"
curl -L --output "/tmp/bazelisk" "${DOWNLOAD_URL}"
chmod +x "/tmp/bazelisk"
# Install to /usr/local/bin, as bazel
mv "/tmp/bazelisk" "/usr/local/bin/bazel"
fi

# Build and upload etcdadm binary
make etcdadm
gsutil -h "Cache-Control:private, max-age=0, no-transform" -m cp -n etcdadm ${ARTIFACT_LOCATION}/${VERSION}/etcdadm
Expand Down

0 comments on commit 194b29e

Please sign in to comment.