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)" |
| 13 | DEB="bazel_${VERSION}.deb" |
| 14 | |
| 15 | "${BAZEL_SOURCE}/compile.sh" compile |
| 16 | ( |
| 17 | cd "${BAZEL_SOURCE}" |
| 18 | ./output/bazel build //scripts/packages:bazel-debian --embed_label="${VERSION}" |
| 19 | ) |
| 20 | |
| 21 | cp "${BAZEL_SOURCE}/bazel-bin/scripts/packages/bazel-debian.deb" "${DEB}" |
| 22 | |
| 23 | echo "Output is at ${DEB}" |