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 | |
| 12 | VERSION="$(date +%Y%m%d%H%M)+$(GIT_DIR="${BAZEL_SOURCE}/.git" git rev-parse --short HEAD)" |
Brian Silverman | d1c19fb | 2016-07-07 00:10:57 -0700 | [diff] [blame] | 13 | DEB="bazel_${VERSION}_amd64.deb" |
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 | 4f85729 | 2018-02-15 23:42:04 -0800 | [diff] [blame] | 17 | bazel build -c opt //scripts/packages/debian:bazel-debian --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 | 4f85729 | 2018-02-15 23:42:04 -0800 | [diff] [blame] | 20 | cp "${BAZEL_SOURCE}/bazel-bin/scripts/packages/debian/bazel-debian.deb" "${DEB}" |
Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 21 | |
| 22 | echo "Output is at ${DEB}" |