post {
failure {
script {
def job = Jenkins.instance.getItem("some-job-name"); job.disable();
}
}
}If this actually works, how could I then re-enable this job given there is no button in the UI to enable (or even disable) a multi-branch job?
I thought this would be possible after the fix in https://issues.jenkins-ci.org/browse/JENKINS-27299, but apparently not so... Hence asking here.
Assuming in a Jenkinsfile, that is run as part of a multi-branch type job, I decide to disable some jobs, e.g:post {
failure {
script {
def job = Jenkins.instance.getItem("some-job-name"); job.disable();
}
}
}If this actually works, how could I then re-enable this job given there is no button in the UI to enable
(or even disable) a multi-branch job?
--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/57001001-e365-4c14-b901-5ee4f8417bb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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/CwXkESYhfDs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BnPnMxORekN_hv_SAuJ2LsaCtYUqZ%2BOr7BCT%2BRQFkEbwktCww%40mail.gmail.com.


--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/63a5e368-ff1a-4898-b86f-1eee9536961c%40googlegroups.com.
no.What you really want to do is not have those branches build automatically.... effectively you want to turn the multbranch source to be something likeor (assuming you want master to still build automatically)Should be possible to configure that by groovy or a plugin
On 30 May 2017 at 20:19, Idan Adar <id...@adar.me> wrote:
To disable, can I point to a branch like so?def job = Jenkins.instance.getItem("job-name/branch-name"); job.disable();And then to enable, maybe it could be achieved also programmatically?def job = Jenkins.instance.getItem("job-name/branch-name"); job.enable();
--
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 jenkinsci-use...@googlegroups.com.
I actually do want these to build automatically. I control what then happens in the jenkinsfile...
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e9347b6-b304-4c74-bb33-e3c119b9ac06%40googlegroups.com.