Add Bazelisk support to Dockerfile.custom

This commit is contained in:
Tiger Watson 2021-06-29 13:25:07 +00:00 committed by Rémy Coutable
parent 5c31ab00a7
commit a7e1e727ef
5 changed files with 45 additions and 1 deletions

View file

@ -185,6 +185,19 @@ function print_pgbouncer_args() {
printf -- "--build-arg PGBOUNCER_DOWNLOAD_SHA256=%s " "$PGBOUNCER_DOWNLOAD_SHA256"
}
function print_bazelisk_args() {
case "$1" in
1.9.0)
BAZELISK_VERSION=1.9.0
BAZELISK_DOWNLOAD_SHA256=b8c7f2a1b07ad64a2f27f8f19a202f90d044de7b5b6ccc387a6fe5d4a8ec4937
;;
*) echo "Unknown bazelisk version $1"; exit 1;
esac
printf -- "--build-arg BAZELISK_VERSION=%s " "$BAZELISK_VERSION"
printf -- "--build-arg BAZELISK_DOWNLOAD_SHA256=%s " "$BAZELISK_DOWNLOAD_SHA256"
}
function print_ruby_args() {
case "$1" in
2.6|2.6.*)
@ -230,6 +243,7 @@ function parse_arguments() {
postgresql) print_postgres_args $version ;;
graphicsmagick) print_graphicsmagick_args $version ;;
pgbouncer) print_pgbouncer_args $version ;;
bazelisk) print_bazelisk_args $version ;;
*) exit 1;;
esac
done

14
scripts/install-bazelisk Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
set -xeou pipefail
BAZELISK_VERSION=${1}
BAZELISK_DOWNLOAD_SHA256=${2}
BAZELISK_DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-amd64"
curl -fsSL "$BAZELISK_DOWNLOAD_URL" -o bazelisk
echo "${BAZELISK_DOWNLOAD_SHA256} bazelisk" | sha256sum -c -
chmod +x bazelisk
mv bazelisk /usr/local/bin/bazel