Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # This script builds a Debian package from a Bazel source tree with the |
| 4 | # correct version. |
| 5 | # The only argument is the path to a Bazel source tree. |
| 6 | |
| 7 | set -e |
| 8 | set -u |
| 9 | |
| 10 | BAZEL_SOURCE="$1" |
| 11 | |
Austin Schuh | e18baff | 2018-10-20 17:40:42 -0700 | [diff] [blame] | 12 | VERSION="0.19.0rc4-$(date +%Y%m%d%H%M)+$(GIT_DIR="${BAZEL_SOURCE}/.git" git rev-parse --short HEAD)" |
Austin Schuh | 137d945 | 2018-07-07 15:42:36 -0700 | [diff] [blame] | 13 | OUTPUT="bazel_${VERSION}" |
Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 14 | |
Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 15 | ( |
| 16 | cd "${BAZEL_SOURCE}" |
Austin Schuh | 137d945 | 2018-07-07 15:42:36 -0700 | [diff] [blame] | 17 | bazel build -c opt //scripts/packages:with-jdk/bazel-real --embed_label="${VERSION}" --stamp=yes --experimental_sandbox_base=/dev/shm |
Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 18 | ) |
| 19 | |
Austin Schuh | 137d945 | 2018-07-07 15:42:36 -0700 | [diff] [blame] | 20 | cp "${BAZEL_SOURCE}/bazel-genfiles/scripts/packages/with-jdk/bazel-real" "${OUTPUT}" |
| 21 | xz "${OUTPUT}" |
Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 22 | |
Austin Schuh | 137d945 | 2018-07-07 15:42:36 -0700 | [diff] [blame] | 23 | echo "Output is at ${OUTPUT}.xz" |