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
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.