Add 'builder-sandbox' job to Releng 73/17273/1
authorTrevor Bramwell <tbramwell@linuxfoundation.org>
Tue, 19 Jul 2016 21:20:20 +0000 (14:20 -0700)
committerTrevor Bramwell <tbramwell@linuxfoundation.org>
Thu, 21 Jul 2016 00:24:11 +0000 (17:24 -0700)
Any changes slated for the 'sandbox' branch of this repo will be
published to https://sandbox.opnfv.org, with the exception of the
releng-ci jobs themselves. This will provide visibility to changes
slated for Jenkins and allow for easier understanding of how JJB works
for new users.

- Step [2/2] in publishing jobs to the Jenkins sandbox

JIRA: RELENG-91

Change-Id: I94c28081b1d96e5eae76a4f1f11dcf5cb9b6cf35
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
jjb/releng/releng-ci-jobs.yml

index 60551f5..f346c1c 100644 (file)
@@ -2,6 +2,7 @@
     name: builder-jobs
     jobs:
         - 'builder-verify-jjb'
+        - 'builder-sandbox'
         - 'builder-merge'
         - 'artifacts-api'
 
                 git pull
                 jenkins-jobs update --delete-old jjb/
 
+- job-template:
+    name: 'builder-sandbox'
+
+    # Upload all jjb jobs to sandbox instance, excluding jobs jjb
+    # builder jobs
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: 'master'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            choosing-strategy: 'default'
+
+    triggers:
+        - gerrit:
+            trigger-on:
+                - change-merged-event
+                - comment-added-contains-event:
+                    comment-contains-value: 'remerge'
+            projects:
+              - project-compare-type: 'ANT'
+                project-pattern: 'releng'
+                branches:
+                    - branch-compare-type: 'ANT'
+                      branch-pattern: '**/sandbox'
+                file-paths:
+                    - compare-type: ANT
+                      pattern: jjb/**
+                    - compare-type: ANT
+                      pattern: utils/**
+
+    builders:
+        - shell:
+            !include-raw: verify-releng.sh
+        - shell: |
+                #!/bin/bash
+                source /opt/virtualenv/jenkins-job-builder/bin/activate
+                cd /opt/jenkins-ci/releng
+                git pull
+                cp /etc/jenkins_jobs/jenkins_jobs.ini jenkins_sandbox.ini
+                sed -i 's/url=.*/url=https:\/\/sandbox.opnfv.org\//g' jenkins_sandbox.ini
+                jenkins-jobs --conf jenkins_sandbox.ini update -r -x jjb/releng --delete-old jjb
+                rm -f jenkins_sandbox.ini
+
 - job-template:
     name: 'artifacts-api'