Remove build triggers section

67 views
Skip to first unread message

Davi Diório Mendes

unread,
May 31, 2016, 9:38:20 AM5/31/16
to Jenkins Users
Hi everyone,

I am working with gearman serving multiples jenkins master.
The team's architect asked me a way remove build triggers section of jenkins projects, in order to let a gearman client trigger the jobs.

I searched a lot and found nothing. Does someone know a plugin to this, or knows if it is programatically possible by a groovy script or even a new plugin?

BR.

Victor Martinez

unread,
May 31, 2016, 11:59:22 AM5/31/16
to Jenkins Users
Hi,

You can easily iterate through jenkins groovy api and use the method http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#removeTrigger(hudson.triggers.TriggerDescriptor) in addition to http://javadoc.jenkins-ci.org/hudson/model/AbstractProject.html#getTriggers()


Something line

Jenkins.instances?.items.findAll { it.getTrigers () }.each{

//iterate through each trigger and remove it

}

I haven't tested it out, but something like that it should work

Cheers

Davi Diório Mendes

unread,
May 31, 2016, 12:42:31 PM5/31/16
to jenkins...@googlegroups.com
This looks like solves my problem!

Thanks for response


--
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/l-4c3SghZxs/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/30d947e7-9e3f-4677-bfaa-2f7bc33579dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Davi Diório Mendes
Eng. de Computação - Turma de 2011
Universidade de São Paulo - EESC/ICMC

Daniel Beck

unread,
May 31, 2016, 5:37:49 PM5/31/16
to jenkins...@googlegroups.com

> On 31.05.2016, at 17:59, Victor Martinez <victormar...@gmail.com> wrote:
>
> Jenkins.instances?.items

`items` will not get items in folders, so is very configuration dependent.

`allItems` OTOH will get also get e.g. Matrix configurations.

`getAllItems(TopLevelItem.class)` is probably the best approach.

Reply all
Reply to author
Forward
0 new messages