DO NOT fail if global-vars-.sh is not configured 91/11091/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 7 Jun 2018 02:29:49 +0000 (22:29 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 7 Jun 2018 02:31:17 +0000 (22:31 -0400)
All configurations in jenkins-cfg job should be optional. If a project
does not configure a setting then skip it and continue.

Issue: RELENG-962
Change-Id: I386a6371ce3f1ff1b5cc024760f6d316d5008d63
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
shell/jenkins-configure-global-vars.sh

index 6e64023..af36d10 100644 (file)
@@ -27,6 +27,13 @@ silos="${jenkins_silos:-jenkins}"
 set -eu -o pipefail
 
 for silo in $silos; do
+    if [ ! -f "$WORKSPACE/jenkins-config/global-vars-$silo.sh" ]; then
+        echo "WARN: jenkins-config/global-vars-$silo.sh does not exist. Skipping cloud management..."
+        echo "We highly recommend setting up global-vars-$silo.sh to manage the Jenkins global variables."
+        echo "Refer to https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-ci-jobs.html#global-environment-variables for details."
+        continue
+    fi
+
     set +x  # Ensure that no other scripts add `set -x` and print passwords
     echo "Configuring $silo"