How can I configure plugins from the Script Console

18 views
Skip to first unread message

Rob Oxspring

unread,
Jan 30, 2015, 11:31:37 AM1/30/15
to jenkins...@googlegroups.com
Hi,

I'm looking for a little Script Console assistance...  

I keep wanting to use the script console to make uniform changes across a bunch of jobs - but increasingly finding plugin settings are readonly.  For example we're using the ArtifactoryRedeployPublisher and I can read the per job configuration of the ArtifactoryRedeployPublisher but since there's no setter method I'm unable to update them. 

http://pastebin.com/MQfRxSks

What's the best process to reconfigure these things programmatically?

Baptiste Mathus

unread,
Jan 30, 2015, 11:46:37 AM1/30/15
to jenkins...@googlegroups.com
Hi,

IIUC your question, alas, there's no generic answer/way to do that, and I don't think that'll happen some day. So you'll have to do trial & error to be able to do things through the script console.
First have a look at the examples many of us have dumped there: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console

Then my advice is: open an IDE, load the Jenkins jars + the plugins you want to tinker with, and use the code browsing feature to dig through the APIs, and so on. 

Not sure there's a better way, but I'd be happy to hear about tips & tricks for it.

And obviously, before that, have a look at the conf slicing plugin!
And after, if you find yourself doing things on a regular basis, consider contributing it to that plugin or another.

My 2 cents

Cheers

--
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/78dd6976-6cab-4576-96b7-d83a22f44a6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Reply all
Reply to author
Forward
0 new messages