Skip to content

Commit 6307c5e

Browse files
author
Brendan Szymanski
committed
Add exit status to failed builds
1 parent 8b1599d commit 6307c5e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

devtest

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ upload() {
170170

171171
start() {
172172
log "PACKAGES: ${PACKAGES[*]}"
173+
174+
exit_code=0
173175

174176
update_chroot
175177
for i in "${PACKAGES[@]}" ; do
@@ -266,6 +268,7 @@ start() {
266268
else
267269
echo "Package build failed. See log at $LOG_FILE for details"
268270
BUILD_FAILED+=($i);
271+
exit_code=1
269272

270273
if $EXIT_ON_FAILURE; then
271274
break
@@ -289,6 +292,8 @@ start() {
289292
if [ ${#UPLOAD_FAILED[@]} -gt 0 ]; then
290293
echo "The following packages failed to upload: ${UPLOAD_FAILED[*]}"
291294
fi
295+
296+
return $exit_code
292297
}
293298

294299
log() {
@@ -329,8 +334,6 @@ show_version() {
329334

330335
setup
331336

332-
packages=()
333-
334337
options=$(getopt -o "hVucRiv" -l "help,verbose,upload,clean,rebuild,install,version" -a -- "$@")
335338

336339
# If getopt returns a non-zero code, exit the program.
@@ -376,3 +379,5 @@ if [ ${#PACKAGES[@]} -eq 0 ]; then
376379
fi
377380

378381
start 2>&1 | tee $LOG_FILE
382+
383+
exit ${PIPESTATUS[0]}

0 commit comments

Comments
 (0)