]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Move ceph-ansible and ceph-docker builds to 2.jenkins.ceph.com 823/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 8 Aug 2017 21:01:05 +0000 (17:01 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 16 Aug 2017 16:24:41 +0000 (12:24 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
14 files changed:
ceph-ansible-docs-prs/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-docs/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-galaxy/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-nightly/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-pr-syntax-check/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-prs/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-rpm/config/JENKINS_URL [new file with mode: 0644]
ceph-ansible-scenario/config/JENKINS_URL [new file with mode: 0644]
ceph-docker-flake8/config/JENKINS_URL [new file with mode: 0644]
ceph-docker-lint/config/JENKINS_URL [new file with mode: 0644]
ceph-docker-nightly/config/JENKINS_URL [new file with mode: 0644]
ceph-docker-prs/config/JENKINS_URL [new file with mode: 0644]
jenkins-job-builder/build/build
jenkins-job-builder/config/definitions/jjb.yml

diff --git a/ceph-ansible-docs-prs/config/JENKINS_URL b/ceph-ansible-docs-prs/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-docs/config/JENKINS_URL b/ceph-ansible-docs/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-galaxy/config/JENKINS_URL b/ceph-ansible-galaxy/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-nightly/config/JENKINS_URL b/ceph-ansible-nightly/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-pr-syntax-check/config/JENKINS_URL b/ceph-ansible-pr-syntax-check/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-prs/config/JENKINS_URL b/ceph-ansible-prs/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-rpm/config/JENKINS_URL b/ceph-ansible-rpm/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-ansible-scenario/config/JENKINS_URL b/ceph-ansible-scenario/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-docker-flake8/config/JENKINS_URL b/ceph-docker-flake8/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-docker-lint/config/JENKINS_URL b/ceph-docker-lint/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-docker-nightly/config/JENKINS_URL b/ceph-docker-nightly/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
diff --git a/ceph-docker-prs/config/JENKINS_URL b/ceph-docker-prs/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e97cf67
--- /dev/null
@@ -0,0 +1 @@
+2.jenkins.ceph.com
index cdaf349ec717ffc06eec8641fb2bc51748f939c1..26cad72a19803f8abc39298cdc5a9eb672c3d3cd 100644 (file)
@@ -15,9 +15,10 @@ install_python_packages "pkgs[@]"
 # Wipe out JJB's cache if $FORCE is set.
 [ "$FORCE" = true ] && rm -rf "$HOME/.cache/jenkins_jobs/"
 
-# workaround for https://issues.jenkins-ci.org/browse/JENKINS-16225
-JENKINS_URL=${JENKINS_URL:-"https://jenkins.ceph.com/"}
-JJB_CONFIG="$HOME/.jenkins_jobs.ini"
+# Each jenkins master will write its own config file when the
+# jenkins-job-builder gets run
+JENKINS_FQDN=$(echo $JENKINS_URL | awk -F/ '{print $3}')
+JJB_CONFIG="$HOME/.jenkins_jobs.$JENKINS_FQDN.ini"
 
 # slap the programatically computed JJB config using env vars from Jenkins
 cat > $JJB_CONFIG << EOF
@@ -34,12 +35,26 @@ for dir in `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
     if [ -d "$definitions_dir" ]; then
         echo "found definitions directory: $definitions_dir"
 
-        # Test the definitions first
-        $VENV/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG test $definitions_dir -o /tmp/output
-
-        # 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/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG update $definitions_dir
+        # Set with JJB config file we should use based on if an override
+        # file is present in the job's config dir
+        if [ -f "$dir/config/JENKINS_URL" ]; then
+            JENKINS_URL_OVERRIDE=$(cat $dir/config/JENKINS_URL)
+            echo "found JENKINS_URL override file.  using $JENKINS_URL_OVERRIDE"
+            JJB_CONFIG="$HOME/.jenkins_jobs.$JENKINS_URL_OVERRIDE.ini"
+        else
+            JJB_CONFIG="$HOME/.jenkins_jobs.jenkins.ceph.com.ini"
+        fi
+
+        # Each jenkins-job-builder job should only update the master
+        # that started it.  This prevents collisions.
+        if [[ "$JJB_CONFIG" == "$HOME/.jenkins_jobs.$JENKINS_FQDN.ini" ]]; then
+            # Test the definitions first
+            $VENV/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG test $definitions_dir -o /tmp/output
+
+            # 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/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG update $definitions_dir
+        fi
     fi
 done
index 869ab0c9c4f96de48dfdc6387e207f8eb1f63f19..b269c2f969963fd0abcc95a17dcf580014e41ba5 100644 (file)
@@ -47,6 +47,6 @@ If this is checked, JJB will wipe out its cache and force each job to align with
     publishers:
       - postbuildscript:
           builders:
-            - shell: 'rm $HOME/.jenkins_jobs.ini'
+            - shell: 'rm $HOME/.jenkins_jobs.*.ini'
         script-only-if-succeeded: false
         script-only-if-failed: false