Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chefren/4281639b7ec5e12f1cc5cb10132915de to your computer and use it in GitHub Desktop.

Select an option

Save chefren/4281639b7ec5e12f1cc5cb10132915de to your computer and use it in GitHub Desktop.
Mass install/update of Jenkins Plugins

Scripted Jenkins Plugins install

Jenkins has a very rich catalog of plugins and it's quite easy to install and update them via UI. BTW, when you want to add tons of plugin via UI, it's a fairly long and boring procedure.

Hopefully, mass installation (or update) could be easy using a simple bash script (curl/python required) :

Create a file containing plugins to be installed (or updated), ie iplugins :

analysis-core
audit-trail
build-flow-plugin
buildgraph-view
build-metrics
build-timeout
changelog-history
claim
config-file-provider
configurationslicing
console-column-plugin
dashboard-view
greenballs
htmlpublisher
mercurial
sonar
ssh-agent
thucydides
timestamper
viewVC
WebSVN2

If you want some plugins to be excluded, for example those found in dependency list, create a second file with excluded list (ie, xplugins):

ant
antisamy-markup-formatter
credentials
cvs
external-monitor-job
javadoc
ldap
mailer
matrix-auth
maven-plugin
pam-auth
ssh-credentials
ssh-slaves
subversion
translation
windows-slaves

Then get script :

curl -L https://raw.githubusercontent.com/hgomez/devops-incubator/master/forge-tricks/batch-install-jenkins-plugins.sh -o batch-install-jenkins-plugins.sh
  • --plugins (or -p) is for file containing plugins to be installed

  • --excludedplugins (or -e) is for file containing plugins to be excluded

  • --plugindir (or -p) is for directory path to copy plugins (.jpi)

    batch-install-jenkins-plugins.sh --plugins iplugins --excludedplugins xplugins --plugindir /var/lib/myjenkins/plugins

batch-install-jenkins-plugins.sh will download json file containing up to date plugins and will download plugins to be installed and non optional dependent plugins

Script powo !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment