I am using pipeline jobs with Jenkins 2.0, but I don\'t see option \'disable job\' as I was used to in older Jenkins versions. Am I missing something? Is it still possible to di
You can simply use the "Disable Project" option from Jenkins 2.89.4 onward in order to disable the pipeline Jobs.
If, like me, your Jenkins jobs are automatically created by a DSL workflow, you won't be able to edit the configuration of the top-level Job, that contains all the actual branches, to disable the automatic builds from github hooks. I can't currently find a way to programmatically disable an entire pipeline in the jenkinsfile, outside of using the when triggered by
clause on every stage as mentioned in this other SO answer. Besides, that would cause it to run and succeed, which might not be what we want.
So the solution that felt least-hacky to me was:
Jenkinsfile
, so that Jenkins' SCM polling doesn't pick it up. I chose Jenkinsfile.manual
. This assumes that the job-auto-creator is set to look for "Jenkinsfile"; adjust as necessary.Jenkinsfile.manual
(or whatever you choose to call it).This feels "right" to me, your mileage my vary.
If you don't find the disable button. This should do the trick for most of the Jobs. Just append /disable
to the end of Job URL. Then Jenkins will redirect you to a page where you can Post
. Same applies for /enable
too
For multibranch pipeline projects,
Now, no github branch trigger will run a build job. (This will disable triggers for all branches)
There is no option to disable jenkins-pipeline job.
The following jira ticket is tracking the issue:
https://issues.jenkins-ci.org/browse/JENKINS-27299