Looks like this is the solution: https://issues.jenkins-ci.org/browse/JENKINS-27299 But only once it actually get merged. Otherwise this is a no-go for multi-branch pipelines...
On Tuesday, April 4, 2017 at 12:07:55 PM UTC+3, Idan Adar wrote: > > Thanks! > > I looked at the job, which is a multi-branch pipeline, and I did not see > any disable or enable button. So assume the job does get somehow disabled > via code, how would I enable it (manually)? only by code? > > On Tue, Apr 4, 2017 at 11:35 AM, 'Maciej Jaros' via Jenkins Users < > [email protected]> wrote: > >> Idan Adar (2017-04-03 15:11): >> >> Hello, >> >> I received a request, which sounds kinda far-fetched to me, but maybe I >> wrong. >> >> Lets assume there is a job that is scheduled to run 3 times ago. End to >> end sort of tests. And at some point one of the job runs fails. >> The request here is to block all future PRs for any repository in GitHub >> from triggering their respective jobs (each repo has a Jenkinsfile, a PR >> triggers it). >> >> Is this at all possible? Blocking all jobs until an error is fixed? >> >> >> I think you would have to manually enable builds after the error is >> fixed, but you can disable builds with Groovy: >> def job = Jenkins.instance.getItem("your-job-name"); >> job.disable() >> //job.enable() >> >> Regards, >> Nux. >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Jenkins Users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/jenkinsci-users/YcdTo2AZgiA/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/f5fecaad-dbc3-d665-c35f-15e97345d2fa%40mol.com.pl >> >> <https://groups.google.com/d/msgid/jenkinsci-users/f5fecaad-dbc3-d665-c35f-15e97345d2fa%40mol.com.pl?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > *Idan Adar* > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/02cc3246-25cf-4b74-ba25-29ac580da16e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
