aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/ci/build.sh
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-11-10 16:09:34 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-11-10 16:17:57 +0000
commit736c46d746145657784b589ea7b5efd09c561692 (patch)
tree350a5c4efdeb6cc4e9eb5ca3482a8a6e966a559a /scripts/ci/build.sh
parent2982609a07d9b22f55c1421a97379de161bb791d (diff)
On ci, bootstrap from a bootstrap bazel
With the implementation of the distribution-artifact design, calling ./compile.sh on a git checkout won't work any more unless you already have the correct version of the protoc installed. To prepare for that, and to also keep the maintenance burden for the ci slaves low, we build bazel on the ci machines with the latest release of bazel as bootstrap bazel. -- Change-Id: I18953489cc7282586d6d0a3911ec94e11215a540 Reviewed-on: https://bazel-review.googlesource.com/#/c/6771 MOS_MIGRATED_REVID=138761693
Diffstat (limited to 'scripts/ci/build.sh')
-rwxr-xr-xscripts/ci/build.sh21
1 files changed, 5 insertions, 16 deletions
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
index de7578a31e..06c10261e2 100755
--- a/scripts/ci/build.sh
+++ b/scripts/ci/build.sh
@@ -39,6 +39,8 @@ source $(dirname ${SCRIPT_DIR})/release/common.sh
: ${RELEASE_CANDIDATE_URL:="${GCS_BASE_URL}/${GCS_BUCKET}/%release_name%/rc%rc%/index.html"}
: ${RELEASE_URL="${GIT_REPOSITORY_URL}/releases/tag/%release_name%"}
+: ${BOOTSTRAP_BAZEL:=bazel}
+
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
if [[ ${PLATFORM} == "darwin" ]]; then
function checksum() {
@@ -50,9 +52,6 @@ else
}
fi
-GIT_ROOT="$(git rev-parse --show-toplevel)"
-BUILD_SCRIPT_PATH="${GIT_ROOT}/compile.sh"
-
# Returns the full release name in the form NAME(rcRC)?
function get_full_release_name() {
local rc=$(get_release_candidate)
@@ -122,13 +121,6 @@ function bazel_build() {
fi
setup_android_repositories
- retCode=0
- ${BUILD_SCRIPT_PATH} ${BAZEL_COMPILE_TARGET:-all} || retCode=$?
-
- # Exit for failure except for test failures (exit code 3).
- if (( $retCode != 0 && $retCode != 3 )); then
- exit $retCode
- fi
# Build the packages
local ARGS=
@@ -136,18 +128,19 @@ function bazel_build() {
xcodebuild -showsdks 2> /dev/null | grep -q '\-sdk iphonesimulator'; then
ARGS="--define IPHONE_SDK=1"
fi
- ./output/bazel --bazelrc=${BAZELRC:-/dev/null} --nomaster_bazelrc build \
+ ${BOOTSTRAP_BAZEL} --bazelrc=${BAZELRC:-/dev/null} --nomaster_bazelrc build \
--embed_label=${release_label} --stamp \
--workspace_status_command=scripts/ci/build_status_command.sh \
--define JAVA_VERSION=${JAVA_VERSION} \
${ARGS} \
+ //src:bazel \
//site:jekyll-tree \
//scripts/packages || exit $?
if [ -n "${1-}" ]; then
# Copy the results to the output directory
mkdir -p $1/packages
- cp output/bazel $1/bazel
+ cp bazel-bin/src/bazel $1/bazel
cp bazel-bin/scripts/packages/install.sh $1/bazel-${release_label}-installer.sh
if [ "$PLATFORM" = "linux" ]; then
cp bazel-bin/scripts/packages/bazel-debian.deb $1/bazel_${release_label}.deb
@@ -157,10 +150,6 @@ function bazel_build() {
cp bazel-genfiles/site/jekyll-tree.tar $1/www.bazel.build.tar
cp bazel-genfiles/scripts/packages/README.md $1/README.md
fi
-
- if (( $retCode )); then
- export BUILD_UNSTABLE=1
- fi
}
# Generate a string from a template and a list of substitutions.