summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2018-12-21 18:30:52 +0000
committerMark Lapierre <mlapierre@gitlab.com>2018-12-21 18:30:52 +0000
commit38a10e387021024e35d1985aebe3d50591d9a6c9 (patch)
treeed2184541bdedb961bb0b61bf04d1351c307a675
parenta9049532a271117983430d2d80b8ad61879ecf7a (diff)
downloadgitlab-ce-exit-error-if-job-waited-fails.tar.gz
Exit as error if job failsexit-error-if-job-waited-fails
If a script is waiting for a job to be done and that job fails, exit with an error status so that the script doesn't continue with a prerequisite in an invalid state.
-rwxr-xr-xscripts/review_apps/review-apps.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh
index 9e52366f800..118a7c7f638 100755
--- a/scripts/review_apps/review-apps.sh
+++ b/scripts/review_apps/review-apps.sh
@@ -344,6 +344,7 @@ function wait_for_job_to_be_done() {
if [[ "${job_status}" == "failed" ]]; then
echo "The '${job_name}' failed."
+ exit 1
elif [[ "${job_status}" == "manual" ]]; then
echo "The '${job_name}' is manual."
else