Install Jenkins Plugins using Command Line Interface

Maulik Shah
Aug 23, 2017 · 1 min read

1. Download Jenkins CLI file from Jenkins by executing below command

a. Wget http://<Jenkins-Server-IP-Address>:<Port>/jnlpJars/jenkins-cli.jar

b. Navigate to Path

2. Steps to Create Shell script

a. Create Shell Script for installation of plugins:

#!/bin/sh

java -jar jenkins-cli.jar -s http://$1/ install-plugin parameterized-trigger <Plugin_1 URL> <Plugin_2 URL> — username $2 — password $3 –restart

b. Select required plaugins from below url

http://updates.jenkins-ci.org/download/plugins/

c. Set Parameters as below

Param1: IP Address with Port — (locahost:8080)

Param2: Jenkins Username — (maulikshah)

Param3: Jenkins Password — (password)

d. Save Shell script

3. How to run the shell script

sh <Script name>.sh param1 param2 param3

For Example: sh install_jenkins_plugins.sh localhost:8080 maulikshah password

4. Get list of Installed Plugins

java -jar jenkins-cli.jar -s http://<IP Adddress> list-plugins — username <Username> — password <Password>

For Example: java -jar jenkins-cli.jar -s http:// localhost:8080/ list-plugins — username maulikshah — password password

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade