Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install plugins in jenkins, with the help of jenkins remote access API?

I would like to know, how can I install a plugin to Jenkins, using the Jenkins Remote access API? I found a way to install using jenkins CLI. But I need to know how to do the same using API. I tried using jenkins-python library. But I did not find any way to install plugin there.

like image 320
Harish Kayarohanam Avatar asked Mar 19 '12 06:03

Harish Kayarohanam


1 Answers

Send (HTTP POST) the following xml data (with your plugin-id@version) to Jenkins plugin manager. Check out my jenkins install plugin script on gist.

This HTTP POST request install jenkins git plugin 2.0.

curl -X POST -d '<jenkins><install plugin="[email protected]" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins

like image 179
Ben Asmussen Avatar answered Sep 22 '22 05:09

Ben Asmussen