]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
jjb: rename to "jenkins-job-builder" 139/head
authorKen Dreyer <kdreyer@redhat.com>
Mon, 5 Oct 2015 20:50:56 +0000 (14:50 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Mon, 5 Oct 2015 20:51:57 +0000 (14:51 -0600)
Rename this job's configuration to match its job name.

ansible/roles/ansible-jenkins/files/jobs/jenkins-job-builder/config.xml
jenkins-job-builder/config/config [new file with mode: 0644]
jenkins-job-builder/config/definitions/jjb.yml [new file with mode: 0644]
jjb/config/config [deleted file]
jjb/config/definitions/jjb.yml [deleted file]

index 336b140a765776cde84ab5d7639d1e1a32e7744f..3f75ff98c737cda9bf4505c8bb02bd9081408ae1 100644 (file)
@@ -62,7 +62,7 @@
   </triggers>
   <builders>
     <hudson.tasks.Shell>
-      <command>bash jjb/config/config</command>
+      <command>bash jenkins-job-builder/config/config</command>
     </hudson.tasks.Shell>
   </builders>
   <publishers/>
diff --git a/jenkins-job-builder/config/config b/jenkins-job-builder/config/config
new file mode 100644 (file)
index 0000000..b0b03ea
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+#
+# This script uses Jenkins Job Builder to generate the configuration for its own
+# job so that it automatically configures all other jobs that have their YAML
+# definitions.
+#
+
+set -ex
+
+# Create the virtualenv
+virtualenv venv
+. venv/bin/activate
+
+# Define and ensure the PIP cache
+PIP_SDIST_INDEX="$HOME/.cache/pip"
+mkdir -p $PIP_SDIST_INDEX
+
+# Install the package by trying with the cache first, otherwise doing a download only, and then
+# trying to install from the cache again.
+if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder; then
+    venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" jenkins-job-builder
+    venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder
+fi
+
+# 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 `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
+    definitions_dir="$dir/config/definitions"
+    if [ -d "$definitions_dir" ]; then
+        echo "found definitions directory: $definitions_dir"
+
+        # Test the definitions first
+        venv/bin/jenkins-jobs 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/bin/jenkins-jobs update $definitions_dir
+    fi
+done
diff --git a/jenkins-job-builder/config/definitions/jjb.yml b/jenkins-job-builder/config/definitions/jjb.yml
new file mode 100644 (file)
index 0000000..076b92f
--- /dev/null
@@ -0,0 +1,28 @@
+- job:
+    name: jenkins-job-builder
+    node: trusty
+    project-type: freestyle
+    defaults: global
+    disabled: false
+    display-name: 'Jenkins Job Builder'
+    concurrent: true
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    retry-count: 3
+
+    triggers:
+      - pollscm: "H */3 * * *"
+      - github
+
+    scm:
+      - git:
+          url: https://github.com/ceph/ceph-build.git
+          branches:
+            - master
+          browser: githubweb
+          browser-url: http://github.com/ceph/ceph-build.git
+          timeout: 20
+
+    builders:
+      - shell: "bash jenkins-job-builder/config/config"
diff --git a/jjb/config/config b/jjb/config/config
deleted file mode 100644 (file)
index b0b03ea..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env bash
-
-#
-# This script uses Jenkins Job Builder to generate the configuration for its own
-# job so that it automatically configures all other jobs that have their YAML
-# definitions.
-#
-
-set -ex
-
-# Create the virtualenv
-virtualenv venv
-. venv/bin/activate
-
-# Define and ensure the PIP cache
-PIP_SDIST_INDEX="$HOME/.cache/pip"
-mkdir -p $PIP_SDIST_INDEX
-
-# Install the package by trying with the cache first, otherwise doing a download only, and then
-# trying to install from the cache again.
-if ! venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder; then
-    venv/bin/pip install --download-directory="$PIP_SDIST_INDEX" jenkins-job-builder
-    venv/bin/pip install --find-links="file://$PIP_SDIST_INDEX" --no-index jenkins-job-builder
-fi
-
-# 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 `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
-    definitions_dir="$dir/config/definitions"
-    if [ -d "$definitions_dir" ]; then
-        echo "found definitions directory: $definitions_dir"
-
-        # Test the definitions first
-        venv/bin/jenkins-jobs 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/bin/jenkins-jobs update $definitions_dir
-    fi
-done
diff --git a/jjb/config/definitions/jjb.yml b/jjb/config/definitions/jjb.yml
deleted file mode 100644 (file)
index fb678b7..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-- job:
-    name: jenkins-job-builder
-    node: trusty
-    project-type: freestyle
-    defaults: global
-    disabled: false
-    display-name: 'Jenkins Job Builder'
-    concurrent: true
-    quiet-period: 5
-    block-downstream: false
-    block-upstream: false
-    retry-count: 3
-
-    triggers:
-      - pollscm: "H */3 * * *"
-      - github
-
-    scm:
-      - git:
-          url: https://github.com/ceph/ceph-build.git
-          branches:
-            - master
-          browser: githubweb
-          browser-url: http://github.com/ceph/ceph-build.git
-          timeout: 20
-
-    builders:
-      - shell: "bash jjb/config/config"