From 98719a1ae0b5340faaf27d4c3254c1f213701732 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 16 Oct 2014 10:45:49 -0400 Subject: [PATCH] loop around all projects to build Jenkins configurations Signed-off-by: Alfredo Deza --- jjb/config/config | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/jjb/config/config b/jjb/config/config index 234bb783..13b00616 100644 --- a/jjb/config/config +++ b/jjb/config/config @@ -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 -- 2.39.5