Installing plugins

Plugins can be installed on CloudBees Core, CloudBees Jenkins Distribution, CloudBees Jenkins Platform, and CloudBees Jenkins Enterprise 1.x.

If using CloudBees Core masters, these actions can be performed both from Operations Center and from the command line.

If you are testing functionality known to require plugin versions newer than those currently identified as verified or trusted, you can disable the Beekeeper Upgrade Utility for the duration of your tests.

Installing a plugin from Operations Center

Installing an Operations Center plugin is performed through the Manage Plugins page.

To install an Operations Center plugin:

  1. Access the Manage Jenkins area.

  2. On the Manage Jenkins page, scroll down and click menu:Manage Plugins[].

  3. On the resulting Plugin Manager page, check that the plugin is not already installed by clicking the Installed tab and begin typing the name of the Operations Center plugin to install into the top-right menu:Filter[] field.

    If the page’s list shows the plugin, then it is already installed on Operations Center and you need not proceed any further. However, ensure the plugin’s Enabled check box is selected.

    If the plugin does not appear in the list, then it is not installed. Therefore, continue on.

  4. Click the Available tab and begin typing the name of the Operations Center plugin to install into the top-right menu:Filter[] field.

  5. In the page’s list, select the plugin’s menu:Install[] check box on the left.

  6. Scroll down the page and click either the btn:[Install without restart] or btn:[Download now and install after restart] button.

Installing a plugin from Client Master

Installing a Client Master plugin is performed through the Manage Plugins page.

To install a Client Master plugin:

  1. Access the Manage Jenkins area of the appropriate Client Master.

  2. On the Manage Jenkins page, scroll down and click menu:Manage Plugins[].

  3. On the resulting Plugin Manager page, check that the plugin is not already installed by clicking the Installed tab and begin typing the name of the Client Master plugin to install into the top-right menu:Filter[] field.

    If the page’s list shows the plugin, then it is already installed on Client Master and you need not proceed any further. However, ensure the plugin’s Enabled check box is selected.

    If the plugin does not appear in the list, then it is not installed. Therefore, continue on.

  4. Click the Available tab and begin typing the name of the Client Master plugin to install into the top-right menu:Filter[] field.

  5. In the page’s list, select the plugin’s menu:Install[] check box on the left.

  6. Scroll down the page and click either the btn:[Install without restart] or btn:[Download now and install after restart] button.

Installing plugins from the command line

You can use the Jenkins CLI tool to install plugins from the command line instead of via the menu:Manage Plugins[] GUI.

Executing a Groovy script and install a plugin using the CLI

See the CLI user guide for more information on downloading and configuring the Jenkins CLI tool.

The following bash script will execute a Groovy script and install the 'beer' plugin on all the online Client Masters:

#!/usr/bin/env bash

JENKINS_CLI=jenkins-cli.jar
JENKINS_CJOC_URL=http://localhost:8080/
JENKINS_AUTH=admin:admin

if [ -z "$JENKINS_CJOC_URL" ]; then
    echo "Need to set environment variable JENKINS_CJOC_URL (Operations Center root URL)."
    exit 1
fi

if [ -z "$JENKINS_AUTH" ]; then
    echo "Need to set environment variable JENKINS_AUTH (format: 'userId:apiToken')."
    exit 1
fi


if [ -f "$JENKINS_CLI" ]
then
	echo "Using $JENKINS_CLI."
else
	wget -O "$JENKINS_CLI" $JENKINS_CJOC_URL/jnlpJars/jenkins-cli.jar
fi

java -jar $JENKINS_CLI -s $JENKINS_CJOC_URL -auth $JENKINS_AUTH list-masters | jq -r '.data.masters[] | select(.status == "ONLINE") | .url' | while read url; do
	java -jar $JENKINS_CLI -s $url -auth $JENKINS_AUTH groovy = < configuration-script.groovy
	java -jar $JENKINS_CLI -s $url -auth $JENKINS_AUTH install-plugin beer
done