8

I cant see examples of how to do this: https://jenkins.io/doc/book/managing/plugins/

I backup a list of all plugins installed and their versions.

I want to use install-plugin command to install all plugins (and their specific versions) from the list.

I dont see option to specify version to install-plugin command

red888
  • 27,709
  • 55
  • 204
  • 392

2 Answers2

8

To install a specific version you can run the command and pass a parameter with a colon like this: install-plugins.sh git:3.9.1

or alternatively add the list of plugins to a file (plugins.txt for instance):

git:3.9.1
saml:1.0.7

and run it with the following command: install-plugins.sh plugins.txt

For versions of Jenkins 2.357 an up, install-plugins.sh has been removed. The command should now be this: /bin/jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt

CloudWatcher
  • 181
  • 1
  • 11
iomv
  • 2,409
  • 18
  • 28
0

You can download jar file from here: https://github.com/jenkinsci/plugin-installation-manager-tool

$ rm -rf /usr/share/jenkins/plugins/ldap*

$ ls /usr/share/jenkins/plugins/ldap*
ls: cannot access '/usr/share/jenkins/plugins/ldap*': No such file or directory

$ echo $JAVA_OPTS
-Djenkins.install.runSetupWizard=false

$ java $JAVA_OPTS -jar /opt/jenkins-plugin-manager-2.12.8.jar --plugins ldap:2.7
Done

$ ls /usr/share/jenkins/plugins/ldap*
/usr/share/jenkins/plugins/ldap.jpi

$ echo "http://<jenkins-url>/restart"
http://<jenkins-url>/restart

$ ls /usr/share/jenkins/plugins/ldap*
/usr/share/jenkins/plugins/ldap.jpi

/usr/share/jenkins/plugins/ldap:
META-INF  WEB-INF

$ cat /usr/share/jenkins/plugins/ldap/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: rsandell
Build-Jdk: 1.8.0_211
Extension-Name: ldap
Specification-Title: The Jenkins Plugins Parent POM Project
Implementation-Title: ldap
Implementation-Version: 2.7
Group-Id: org.jenkins-ci.plugins
Short-Name: ldap
Long-Name: LDAP Plugin
Url: https://github.com/jenkinsci/ldap-plugin
Compatible-Since-Version: 1.16
Minimum-Java-Version: 1.8
Plugin-Version: 2.7
Hudson-Version: 2.277.1
Jenkins-Version: 2.277.1
Plugin-Dependencies: mailer:1.34
Plugin-Developers:
Plugin-License-Name: The MIT license
Plugin-License-Url: https://opensource.org/licenses/MIT
Plugin-ScmUrl: https://github.com/jenkinsci/ldap-plugin

enter image description here

enter image description here

uzay95
  • 16,052
  • 31
  • 116
  • 182