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 | |
| 15 | "${BAZEL_SOURCE}/compile.sh" compile |
| 16 | ( |
| 17 | cd "${BAZEL_SOURCE}" |
Brian Silverman | d1c19fb | 2016-07-07 00:10:57 -0700 | [diff] [blame^] | 18 | ./output/bazel build -c opt //scripts/packages:bazel-debian --embed_label="${VERSION}" |
Brian Silverman | cce7658 | 2015-10-31 23:38:52 +0000 | [diff] [blame] | 19 | ) |
| 20 | |
| 21 | cp "${BAZEL_SOURCE}/bazel-bin/scripts/packages/bazel-debian.deb" "${DEB}" |
| 22 | |
| 23 | echo "Output is at ${DEB}" |