How To Install Jenkins Plugins From Command Line
Jenkins provides two methods for installing plugins on the controller:
-
Using the "Plugin Manager" in the web UI.
-
Using the Jenkins CLI
install-plugin
command.
Each arroyo will result in the plugin being loaded past Jenkins but may crave different levels of access and trade-offs in club to use.
The ii approaches require that the Jenkins controller be able to download meta-information from an Update Center, whether the primary Update Center operated by the Jenkins project [ane], or a custom Update Middle.
The plugins are packaged every bit cocky-contained .hpi
files, which have all the necessary code, images, and other resources which the plugin needs to operate successfully.
From the web UI
The simplest and most common way of installing plugins is through the Manage Jenkins > Manage Plugins view, available to administrators of a Jenkins environment.
Nether the Available tab, plugins available for download from the configured Update Center tin can be searched and considered:
Most plugins can be installed and used immediately by checking the box next to the plugin and clicking Install without restart.
If the list of available plugins is empty, the controller may be incorrectly configured or has not however downloaded plugin meta-data from the Update Center. Clicking the Check now button forces Jenkins to endeavor to contact its configured Update Eye. |
Using the Jenkins CLI
Administrators may too utilize the Jenkins CLI which provides a control to install plugins. Scripts to manage Jenkins environments, or configuration direction code, may need to install plugins without direct user interaction in the web UI. The Jenkins CLI allows a command line user or automation tool to download a plugin and its dependencies.
java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin SOURCE ... [-deploy] [-proper noun VAL] [-restart] Installs a plugin either from a file, an URL, or from update heart. SOURCE : If this points to a local file, that file will exist installed. If this is an URL, Jenkins downloads the URL and installs that as a plugin.Otherwise the name is assumed to be the curt name of the plugin in the existing update center (like "findbugs"),and the plugin will be installed from the update middle. -deploy : Deploy plugins right abroad without postponing them until the reboot. -proper name VAL : If specified, the plugin will be installed as this short name (whereas unremarkably the name is inferred from the source name automatically). -restart : Restart Jenkins upon successful installation.
Advanced installation
The Update Eye merely allows the installation of the most recently released version of a plugin. In cases where an older release of the plugin is desired, a Jenkins administrator can download an older .hpi
annal and manually install that on the Jenkins controller.
From the web UI
Assuming a .hpi
file has been downloaded, a logged-in Jenkins administrator may upload the file from within the web UI:
-
Navigate to the Manage Jenkins > Manage Plugins folio in the web UI.
-
Click on the Advanced tab.
-
Choose the
.hpi
file from your organization or enter a URL to the.hpi
file under the Deploy Plugin section. -
Deploy the plugin file.
Once a plugin file has been uploaded, the Jenkins controller must be manually restarted in order for the changes to take effect.
On the controller
Assuming a .hpi
file has been explicitly downloaded by a system ambassador, the ambassador can manually place the .hpi
file in a specific location on the file system.
Copy the downloaded .hpi`
file into the JENKINS_HOME/plugins
directory on the Jenkins controller (for example, on Debian systems JENKINS_HOME
is generally /var/lib/jenkins
).
The controller must be restarted earlier the plugin is loaded and fabricated available in the Jenkins environment.
The names of the plugin directories in the Update Site [1] are not always the same as the plugin'due south display proper noun. Searching plugins.jenkins.io for the desired plugin will provide the advisable link to the |
Source: https://www.jenkins.io/doc/book/managing/plugins/
Posted by: maciasforto1988.blogspot.com
0 Response to "How To Install Jenkins Plugins From Command Line"
Post a Comment