diff options
authorOliver Smith <osmith@sysmocom.de>2019-01-24 16:04:03 +0100
committerOliver Smith <osmith@sysmocom.de>2019-01-25 10:35:01 +0100
commitc9fcc6e8a5ed620b342bd201296eec4401042bde (patch)
parentb6c3dd787ad1307fa682a5cb531b5b375f933a95 (diff)
jenkins-common.sh: exit if image fails to build
docker_images_require() must fail when a new image can not be built, even if an old image already exists. We have this situation in a lot of the -latest tests right now, which makes it harder to find the actual error. Note that we can't simply use #!/bin/sh -e in all the jenkins.sh scripts that source jenkins_common.sh, because they must be able to clean up the docker containers on failure. So they can't abort somewhere in the middle of the scripts. We could rewrite them to do the clean up in a trap, but this should be done in a separate commit. Related: OS#3767 Change-Id: I7039089457b62b8798a79c5efd62bd91622986d3
1 files changed, 2 insertions, 2 deletions
diff --git a/jenkins-common.sh b/jenkins-common.sh
index f3d6c61..0dbe8b0 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -7,10 +7,10 @@ docker_images_require() {
# Trigger image build (cache will be used when up-to-date)
if [ -z "$NO_DOCKER_IMAGE_BUILD" ]; then
echo "Building image: $i (export NO_DOCKER_IMAGE_BUILD=1 to prevent this)"
- make -C "../$i"
+ make -C "../$i" || exit 1
- # Detect missing images (build skipped/failure)
+ # Detect missing images (build skipped)
if ! docker_image_exists "$i"; then
echo "ERROR: missing image: $i"
exit 1