Deleting a branch is definitely not an option.

The actual scenario here is that when end-to-end tests are run, if they fail 
then I want to disable all other jobs (why? Because that's the task I was 
handed... I don't necessarily agree with this...). 

In my case those other jobs are of type multi branch.

I can't delete the branch in question because it is the develop branch... :)

So I'm just looking to programmatically disable such jobs and then how to 
manually enable them (after the issue in the test failure was resolved).

 

Sent from my iPhone

> On 30 May 2017, at 23:47, Stephen Connolly <stephen.alan.conno...@gmail.com> 
> wrote:
> 
> 
>> On Tue 30 May 2017 at 20:36, Idan Adar <i...@adar.me> wrote:
>> 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.
> 
> Remove the branch from being discovered... (then it will be an orphaned 
> branch and disabled until eligible for removal according to the orphaned 
> branch strategy you configured)
> 
> Or delete the branch.
> 
>> 
>> 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 
> 
> Well you'd commit to the branch again and then the next build of that branch 
> would enable it... oh but you cannot have another build because the branch is 
> disabled...
> 
> This is in part why the functionality you are looking for is not present. 
> Once you disabled the job it would be stuck there forever.
>> (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-users+unsubscr...@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.
> 
> -- 
> Sent from my phone
> -- 
> 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-users+unsubscr...@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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/F0014F29-3255-40C1-86A2-7EC3DD48B42E%40adar.me.
For more options, visit https://groups.google.com/d/optout.

Reply via email to