Install specific version of plugins with Groovy script

636 views
Skip to first unread message

Alexandre Chaussier

unread,
Apr 28, 2016, 9:38:43 AM4/28/16
to Jenkins Users
Hello,

Today, I use groovy scripts with an Ansible role to manage my Jenkins installation and configuration.

All is OK if I want to use latest versions of plugins, but I would like to know if it is possible to request a specific version of the plugins when I request installation from my groovy code ?

I use the UpdateCenter.getPlugin() method but I don't see where I can add this constraint.


Thanks,

Victor Martinez

unread,
Oct 27, 2016, 9:07:37 AM10/27/16
to Jenkins Users
I'm also looking for a similar groovy command, any ideas?

Daniel Beck

unread,
Oct 27, 2016, 9:28:19 AM10/27/16
to jenkins...@googlegroups.com

> On 28.04.2016, at 11:38, Alexandre Chaussier <alexandre...@gmail.com> wrote:
>
> All is OK if I want to use latest versions of plugins, but I would like to know if it is possible to request a specific version of the plugins when I request installation from my groovy code ?
>
> I use the UpdateCenter.getPlugin() method but I don't see where I can add this constraint.

Update center based installation can only install the one version defined in the update site.

You need to go with URL based installation for specific versions.

geoffroy...@gmail.com

unread,
Apr 20, 2018, 9:43:24 PM4/20/18
to Jenkins Users
Hello
just in case, could someone share a groovy sample script to achieve this?
I guess you have to download .jpi file into /plugins folder (also handling dependencies...), then restart jenkins?
I had written that in shell (ugly but working), but still learning in Groovy!
Thanks in advance

Phillip Dudley

unread,
Dec 18, 2018, 8:56:02 PM12/18/18
to Jenkins Users
Love these answers that aren't finished.

Victor Martinez, do you have an example of what you're talking about?

Victor Martinez

unread,
Dec 19, 2018, 8:44:56 PM12/19/18
to Jenkins Users
Hi Phillip,

I'm afraid I do not have an answer about it as I was in fact looking for an answer at that moment. Maybe I didn't ask correctly... I don't recall what I did instead.

JCasC might solve this or sort of, although it's a beta feature:
https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/README.md#plugin-management


Cheers

RAJENDRA PRASAD

unread,
Dec 20, 2018, 5:56:11 AM12/20/18
to jenkins...@googlegroups.com
Yes Philip,
Please find attachments for Install plugins groovy script and plugins list config file.
I made it configurable You can add or remove the plugins config file.

Note: You cannot install specific version plugins on Jenkins unless it is compatible.
To avoid that problem i removed that version, Jenkins automatically picks latest plugin available for that jerkins  version 
 
Let me know if any other help is required

Don't forget to send me your groovy script to install default users and LDAP authentication script.


Thanks and Regards,
Rajendra Prasad Reddy Penumalli
Mobile:9008566233


--
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/c0a9cb82-a524-40f1-9f1f-c95fc43c1dfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
02_installPlugins.groovy
pluginslist.cfg

RAJENDRA PRASAD

unread,
Dec 20, 2018, 6:03:42 AM12/20/18
to jenkins...@googlegroups.com
One point ,Forgot to mention in my previous  mail.
It just installs the plugins restart you need to do manually.
I tried thorough script it didn't work,
Let me know if you have solution for that using groovy script.

Since my Jenkins server is running on Linux server , i am using curl command to restart server.
 

Thanks and Regards,
Rajendra Prasad Reddy Penumalli

RAJENDRA PRASAD

unread,
Dec 21, 2018, 2:02:59 AM12/21/18
to jenkins...@googlegroups.com
Hi Philip,
I waiting for your mail with solutions for configuring matrix authentication

Thanks
Rajendra
Reply all
Reply to author
Forward
0 new messages