]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
jjb: actually fail if a command doesn't return 0 1337/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Jul 2019 08:47:53 +0000 (10:47 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Jul 2019 15:13:30 +0000 (17:13 +0200)
this sets `-euxo pipefail` to avoid this situation :

```
++ sort
++ grep -v jenkins-job-builder
++ jq -r '.jobs[].name'
/tmp/jenkins7521600802673204021.sh: line 1043: jq: command not found
++ curl -s https://2.jenkins.ceph.com/api/json
[PostBuildScript] - Executing post build scripts.
[jenkins-job-builder] $ /bin/sh -xe /tmp/jenkins7309655147676749318.sh
+ rm /home/jenkins-build/.jenkins_jobs.2.jenkins.ceph.com.ini
Finished: SUCCESS
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
jenkins-job-builder/build/build

index 7f22fab981bb633a82d4bbd147a291c899947bf3..e6eb02def98a2b7e742bb22f060c5301c916744f 100644 (file)
@@ -6,7 +6,7 @@
 # definitions.
 #
 
-set -ex
+set -euxo pipefail
 
 # the following two methods exist in scripts/build_utils.sh
 pkgs=( "jenkins-job-builder==2.0.3" )