]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
loop around all projects to build Jenkins configurations
authorAlfredo Deza <alfredo@deza.pe>
Thu, 16 Oct 2014 14:45:49 +0000 (10:45 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Thu, 16 Oct 2014 14:45:49 +0000 (10:45 -0400)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
jjb/config/config

index 234bb78343751de49378bf86fd5d7f132a6d4282..13b00616c2781cd0ba43818bdd95e2ebac8e2a2b 100644 (file)
@@ -21,12 +21,16 @@ if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenk
     venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder
 fi
 
-# XXX This needs to be done for *every* project defined in the current repo, not only
-# the JJB one.
-# Create the definitions testing them first
-venv/bin/jenkins-jobs test jjb/config/definitions -o /tmp/output
+# Test every definition if available in the current repository and update the jobs
+# if they do define one (they should always define their definitions)
+for dir in `ls .`; do
+    if [[ -d $dir/config ]] && [[ -f $dir/config/definitions ]]; then
+        # Test the definitions first
+        venv/bin/jenkins-jobs test $dir/config/definitions -o /tmp/output
 
-# Update Jenkins with the output
-# Note that this needs proper permissions with the right credentials to the
-# correct Jenkins instance.
-venv/bin/jenkins-jobs update jjb/config/definitions
+        # Update Jenkins with the output if they passed the test phase
+        # Note that this needs proper permissions with the right credentials to the
+        # correct Jenkins instance.
+        venv/bin/jenkins-jobs update $dir/config/definitions
+    fi
+done