blob: 0743bb272bb23dc32abe47aeb22f29e4aa05e0f4 [file] [log] [blame]
#!/bin/bash
# This script builds a Debian package from a Bazel source tree with the
# correct version.
# The only argument is the path to a Bazel source tree.
set -e
set -u
BAZEL_SOURCE="$1"
VERSION="4.0.0rc6-$(date +%Y%m%d%H%M)+$(GIT_DIR="${BAZEL_SOURCE}/.git" git rev-parse --short HEAD)"
OUTPUT="bazel_${VERSION}"
(
cd "${BAZEL_SOURCE}"
bazel build -c opt //scripts/packages:with-jdk/bazel-real --embed_label="${VERSION}" --stamp=yes --experimental_sandbox_base=/dev/shm
)
cp "${BAZEL_SOURCE}/bazel-bin/scripts/packages/with-jdk/bazel-real" "${OUTPUT}"
xz "${OUTPUT}"
echo "Output is at ${OUTPUT}.xz"