]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
jenkins-job-builder: add FORCE parameter 229/head
authorKen Dreyer <kdreyer@redhat.com>
Mon, 16 Nov 2015 23:01:04 +0000 (16:01 -0700)
committerKen Dreyer <kdreyer@redhat.com>
Mon, 16 Nov 2015 23:04:06 +0000 (16:04 -0700)
This will wipe out JJB's cache if set. It is useful for wiping out
changes that may have occurred outside of GitHub's master branch.

For example, if I make a change to a job on a local branch, and I apply
my JJB changes locally, I want to force this jenkins-job-builder job to
wipe out my changes later.

jenkins-job-builder/build/build
jenkins-job-builder/config/definitions/jjb.yml

index a89934a3d0f002689bb69cd0dba78bfa670e5e15..c36efb09cd8a2cb3759ae00b42f6e2e464233274 100644 (file)
@@ -12,6 +12,9 @@ set -ex
 virtualenv venv
 . venv/bin/activate
 
+# Wipe out JJB's cache if $FORCE is set.
+[ "$FORCE" = true ] && rm -rf "$HOME/.cache/jenkins_jobs/"
+
 # Define and ensure the PIP cache
 PIP_SDIST_INDEX="$HOME/.cache/pip"
 mkdir -p $PIP_SDIST_INDEX
index e2c984abac83dd881453d22475ab68df914bafb3..f8bf84016b0b1b46122e00892379f60bd50110ba 100644 (file)
       - github:
           url: https://github.com/ceph/ceph-build
 
+    parameters:
+      - bool:
+          name: FORCE
+          description: "
+If this is unchecked, then JJB will use its cache to update jobs. This makes this JJB job run faster, but it could cause JJB to fail to update some Jenkins jobs if the jobs have been changed outside of this JJB job's workflow. (This is the default.)
+
+If this is checked, JJB will wipe out its cache and force each job to align with the configurations in master."
+
     triggers:
       - github