How to install a plugin in Jenkins manually

后端 未结 12 538
你的背包
你的背包 2020-11-29 17:06

Installing a plugin from the Update center results in:

Checking internet connectivity Failed to connect to http://www.google.com/. Perhaps you need

相关标签:
12条回答
  • 2020-11-29 17:56

    To install plugin "git" with all its dependencies:

    curl -XPOST http://localhost:8080/pluginManager/installNecessaryPlugins -d '<install plugin="git@current" />'
    

    Here, the plugin installed is git ; the version, specified as @current is ignored by Jenkins. Jenkins is running on localhost port 8080, change this as needed. As far as I know, this is the simplest way to install a plugin with all its dependencies 'by hand'. Tested on Jenkins v1.644

    0 讨论(0)
  • 2020-11-29 17:58

    If you use Docker, you should read this file: https://github.com/cloudbees/jenkins-ci.org-docker/blob/master/plugins.sh

    Example of a parent Dockerfile:

    FROM jenkins
    COPY plugins.txt /plugins.txt
    RUN /usr/local/bin/plugins.sh /plugins.txt
    

    plugins.txt

    <name>:<version>
    <name2>:<version2>
    
    0 讨论(0)
  • 2020-11-29 18:02
    1. Download the plugin.
    2. Inside Jenkins: Manage JenkinsManage Plugins → There is a tab called Advanced and on that page there is an option to upload a plugin (the extension of the file must be hpi).

    Sometimes, when you download plugins you may get (.zip) files then just rename with (.hpi) and use the UI to install the plugin.

    0 讨论(0)
  • 2020-11-29 18:02

    This is a way to copy plugins from one Jenkins box to another.

    Copy over the plugins directory:

    scp -r jenkins-box.url.com:/var/lib/jenkins/plugins .
    

    Compress the plugins:

    tar cvfJ plugins.tar.xz plugins
    

    Copy them over to the other Jenkins box:

    scp plugins.tar.xz different-jenkins-box.url.com
    ssh different-jenkins-box.url.com "tar xvfJ plugins.tar.xz -C /var/lib/jenkins"
    

    Restart Jenkins.

    0 讨论(0)
  • 2020-11-29 18:03

    The answers given work, with added plugins.

    If you want to replace/update a built-in plugin like the credentials plugin, that has dependencies, then you have to use the frontend. To automate I use:

     curl -i -F file=@pluginfilename.hpi http://jenkinshost/jenkins/pluginManager/uploadPlugin
    
    0 讨论(0)
  • 2020-11-29 18:04

    I have created a simple script that does the following:

    • Download one or more plugins to the plugin directory
    • Scan all plugins in that directory for missing dependencies
    • download this dependencies as well
    • loop until no open dependencies are left

    The script requires no running jenkins - I use it to provision a docker box.

    https://gist.github.com/micw/e80d739c6099078ce0f3

    0 讨论(0)
提交回复
热议问题