Installing Jenkins Plugins with their Dependencies in One Step

2016-06-02

Assuming that your Jenkins server is listening at port 8080, all you need to do is to run the following curl command:

$ curl -X POST -d '<jenkins><install plugin="git@2.0" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins

Replace git@2.0 with the name of your plugin you’re trying to install by looking for the plugin-id in the plugin’s page.

ie for Docker Build Step, the Plugin ID listed on the page is docker-build-step

So your curl script should look something like:

$ curl -X POST -d '<jenkins><install plugin="docker-build-step@current" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins

Always use @current for the latest version of the plugin.

Also, do not be alarmed if you DO NOT SEE any response on your curl request. Its normal.

Just go to your Update Center at http://jenkins/updateCenter/ and you should see your plugins being installed.

I’m currently working on fyra.sh, a CLI-first static site deployment tool where you push your site and it’s served globally through a built-in CDN, without the overhead of heavy platforms.