diff options
author | 2015-10-02 15:51:27 +0000 | |
---|---|---|
committer | 2015-10-02 18:02:37 +0000 | |
commit | 078a82ef3c5eaf50f1cd31304e8aad480f418e2f (patch) | |
tree | 8c801589b7f4421a9b801f1c41b38baf283227ef /scripts | |
parent | b2c7a87b8feced7ba1321e4a1d2616cdaef24901 (diff) |
[ci] Do not fail on test failure
Instead set a BUILD_UNSTABLE=1 environment variable such
as a subsequent change to Jenkins can mark our build as
unstable instead of failed when we have test flakiness.
This would also allow to test the Tutorial with flaky builds.
--
MOS_MIGRATED_REVID=104501213
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bootstrap/buildenv.sh | 6 | ||||
-rwxr-xr-x | scripts/ci/build.sh | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh index fb54ed4edd..57c86ba98b 100755 --- a/scripts/bootstrap/buildenv.sh +++ b/scripts/bootstrap/buildenv.sh @@ -65,9 +65,13 @@ function run_silent() { } function fail() { + local exitCode=$? + if [[ "$exitCode" = "0" ]]; then + exitCode=1 + fi echo >&2 echo "$1" >&2 - exit 1 + exit $exitCode } function display() { diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index 76d9a62a9c..6929dbfea2 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -135,13 +135,19 @@ function bazel_build() { fi setup_android_repositories - ${BUILD_SCRIPT_PATH} ${BAZEL_COMPILE_TARGET:-all} || exit $? + retCode=0 + ${BUILD_SCRIPT_PATH} ${BAZEL_COMPILE_TARGET:-all} || retCode=$? + + # Exit for failure except for test failures (exit code 3). + if (( $retCode != 3 )); then + exit $retCode + fi # Build the packages ./output/bazel --bazelrc=${BAZELRC:-/dev/null} --nomaster_bazelrc build \ --embed_label=${release_label} --stamp \ --workspace_status_command=scripts/ci/build_status_command.sh \ - //scripts/packages/... + //scripts/packages/... || exit $? if [ -n "${1-}" ]; then # Copy the results to the output directory @@ -150,6 +156,10 @@ function bazel_build() { cp bazel-bin/scripts/packages/install.sh $1/bazel-${release_label}-installer.sh 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. |