blob: 1c10df025f9c24c2788ece5781c7102ef21b3f2a [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
12VERSION="$(date +%Y%m%d%H%M)+$(GIT_DIR="${BAZEL_SOURCE}/.git" git rev-parse --short HEAD)"
13DEB="bazel_${VERSION}.deb"
14
15"${BAZEL_SOURCE}/compile.sh" compile
16(
17cd "${BAZEL_SOURCE}"
18./output/bazel build //scripts/packages:bazel-debian --embed_label="${VERSION}"
19)
20
21cp "${BAZEL_SOURCE}/bazel-bin/scripts/packages/bazel-debian.deb" "${DEB}"
22
23echo "Output is at ${DEB}"