Save the installed plugins as a text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Save the installed plugins as a text

masaru tsuchiyama
Hi

Is there any way to save the information of the installed plugins
as a text, and restore the plugins from the information.

By saving jpi files, it is possible to save and restore the installed
plugins.

But I want to add the information to git repository.
So the information should be a text file.

Regards.
Masaru.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d87ddd07-a338-923a-988f-23063a6c22a2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Save the installed plugins as a text

Victor Martinez

 There are different approaches already explained in the Stacktrace:
  • https://stackoverflow.com/questions/9815273/how-to-get-a-list-of-installed-jenkins-plugins-with-name-and-version-pair
Regarding the second question, I'd rather suggest to use any Configuration management tools, such as Puppet, Chef, Ansible... or Docker, there are plenty of examples about it, look at the docker one:
  • https://hub.docker.com/_/jenkins/
  • Mark Waite got a great docker git repo : https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0cc108a6-903f-4120-8972-8fa9e2799f07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Save the installed plugins as a text

Victor Martinez
Stackoverflow ^^____ ( I typed too fast )

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a2c76be2-7ed3-4e56-b2fe-6bf264d3fd91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Save the installed plugins as a text

Ioannis Moutsatsos-2
In reply to this post by masaru tsuchiyama
Here is the Groovy script that I use to create an install script (using Jenkins CLI) of the plugins on the server . 
You can also modify it if you just want to get the list of your plugins (and their versions)

I have found this useful for cloning the plugins of one server to another. Hope it helps.

/*
* Generates command to install all plugins on this server
* to a remote server whose name is passed in as a variable
* Helpful utility script for cloning the plugin environment of a server
* Author: Ioannis K. Moutsatsos
*/
import jenkins.model.*;
  def destinationServer='jenkinsDestinationServer' //modify this for you destination server
  def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
  def pluginMap=[:]
  def installBuffer=new StringBuffer()
  def url= jenkins.model.Jenkins.instance.getRootUrl()
  
plugins.each {
    println "${it.getShortName()} \n\tversion ${it.getVersion()} \n\t${it.getLongName()}"
    pluginMap["${it.getShortName()}"]="${it.getLongName()}-${it.getVersion()}"
  }
pluginMap.sort().each{key,value->
 // println "$key \n\t $value"
  installBuffer.append(key)
  installBuffer.append(' ')
  
}


println "java -jar jenkins-cli.jar -s http://${destinationServer}:8080/ install-plugin ${installBuffer}"



On Friday, November 17, 2017 at 8:13:46 AM UTC-5, masaru tsuchiyama wrote:
Hi

Is there any way to save the information of the installed plugins
as a text, and restore the plugins from the information.

By saving jpi files, it is possible to save and restore the installed
plugins.

But I want to add the information to git repository.
So the information should be a text file.

Regards.
Masaru.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3d0bdc31-9144-4f14-8cd5-c025f22835aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Save the installed plugins as a text

masaru tsuchiyama
In reply to this post by Victor Martinez
Hi

Thank you for the answers.

Regards.
Masaru


2017-11-17 22:33 GMT+09:00 Victor Martinez <[hidden email]>:
Stackoverflow ^^____ ( I typed too fast )

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a2c76be2-7ed3-4e56-b2fe-6bf264d3fd91%40googlegroups.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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAKQP9ee2%2BOzAGT2wDe-6qHSrkeE6taKSV%2BxzmWUrRrxJWNYXMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.