Add infra-jjb-merge job 24/124/4
authorFatih Degirmenci <fdegir@gmail.com>
Fri, 19 Oct 2018 12:57:58 +0000 (14:57 +0200)
committerFatih Degirmenci <fdegir@gmail.com>
Fri, 19 Oct 2018 13:21:30 +0000 (15:21 +0200)
Change-Id: Ic9faa9e9f6f9d2eef344eb759a937ed04ce962c7
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
jjb/infra/jjb-merge.sh [new file with mode: 0755]
jjb/infra/jjb-merge.yaml [new file with mode: 0644]

diff --git a/jjb/infra/jjb-merge.sh b/jjb/infra/jjb-merge.sh
new file mode 100755 (executable)
index 0000000..fd377e6
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# workaround for https://github.com/pypa/virtualenv/issues/1029
+export PS1=${PS1:-}
+
+cd $WORKSPACE
+echo "Info: Installing OpenStack Jenkins Job Builder (JJB) version $JJB_VERSION from source in venv"
+echo "----------------------------------------------------"
+git clone -q $JJB_GIT_REPO -b $JJB_VERSION > /dev/null 2>&1
+virtualenv .venv -q
+source .venv/bin/activate
+cd jenkins-job-builder && pip install -q -r test-requirements.txt -e .
+echo "Info: Installed JJB"
+jenkins-jobs --version
+echo "----------------------------------------------------"
+echo "Info: Proceeding with job updates"
+echo "----------------------------------------------------"
+cd $WORKSPACE
+jenkins-jobs --conf jjb/global/jenkins_jobs.ini --user $JJB_USERNAME --password $JJB_USERTOKEN \
+    update --recursive --delete-old --workers 4 jjb/
+echo "----------------------------------------------------"
+echo "Info: Done"
diff --git a/jjb/infra/jjb-merge.yaml b/jjb/infra/jjb-merge.yaml
new file mode 100644 (file)
index 0000000..96bf025
--- /dev/null
@@ -0,0 +1,46 @@
+---
+- project:
+
+    name: infra-jjb-merge
+
+    project: infra/cicd
+
+    stream:
+      - master:
+          branch: '{stream}'
+
+    jobs:
+      - infra-jjb-merge-{stream}
+
+
+- job-template:
+    name: infra-jjb-merge-{stream}
+
+    node: ubuntu1804
+
+    disabled: false
+
+    concurrent: false
+
+    parameters:
+      - infra-parameters
+      - project-parameters:
+          project: '{project}'
+          branch: '{branch}'
+      - nordix-gerrit-parameters
+
+    scm:
+      - git-scm
+
+    triggers:
+      - nordix-gerrit-trigger-change-merged:
+          project: '{project}'
+          branch: '{branch}'
+          files: 'jjb/**'
+
+    wrappers:
+      - nordixinfra-jjb-creds-wrapper
+
+    builders:
+      - shell:
+          !include-raw-escape: ./jjb-merge.sh