blob: c961814edbb5ef6af1b26e0ca252a70242f7c157 [file] [log] [blame]
Brian Silvermancce76582015-10-31 23:38:52 +00001#!/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
7set -e
8set -u
9
10BAZEL_SOURCE="$1"
11
Austin Schuhe18baff2018-10-20 17:40:42 -070012VERSION="0.19.0rc4-$(date +%Y%m%d%H%M)+$(GIT_DIR="${BAZEL_SOURCE}/.git" git rev-parse --short HEAD)"
Austin Schuh137d9452018-07-07 15:42:36 -070013OUTPUT="bazel_${VERSION}"
Brian Silvermancce76582015-10-31 23:38:52 +000014
Brian Silvermancce76582015-10-31 23:38:52 +000015(
16cd "${BAZEL_SOURCE}"
Austin Schuh137d9452018-07-07 15:42:36 -070017bazel build -c opt //scripts/packages:with-jdk/bazel-real --embed_label="${VERSION}" --stamp=yes --experimental_sandbox_base=/dev/shm
Brian Silvermancce76582015-10-31 23:38:52 +000018)
19
Austin Schuh137d9452018-07-07 15:42:36 -070020cp "${BAZEL_SOURCE}/bazel-genfiles/scripts/packages/with-jdk/bazel-real" "${OUTPUT}"
21xz "${OUTPUT}"
Brian Silvermancce76582015-10-31 23:38:52 +000022
Austin Schuh137d9452018-07-07 15:42:36 -070023echo "Output is at ${OUTPUT}.xz"