Jenkins plugins for old versions - jenkins

Fore some reasons I have to use Jenkins 2.32 and I need to install some plugins there. Machine with it has no internet, so I only can upload plugin file to install it from file.
So, the problem is there any easy way to obtain required plugin for required Jenkins version with all it's dependencies?
p.s.
I can't update Jenkins - it's out of my power.
p.p.s.
I find only way to download old versions of plugin, but by this way I can't check dependencies and required jenkins version before loading.

I had such an environment before.
Warning: it's an annoying process.
Because there was no internet, we uploaded all plugins manually, i.e. looking at the plugin page (e.g. https://plugins.jenkins.io/git/) and then downloading from the archive (e.g. https://updates.jenkins.io/download/plugins/git) the .hpi file. As you have to use a relatively old version of Jenkins you may want to check the changelog of the plugin, if you have to use an older version.
In addition on each plugin page the dependencies are listed and you have to repeat the above steps for each dependency.
The only good thing is that usually Jenkins gives you hints, which dependencies are missing after you uploaded a plugin.

You can probably extract the information out of the plugin-versions.json in the Jenkins Update Center.
For more information about the layout of update center, see this document.
You may also find my previous response on jenkins failed to install plugins - docker image (with groovy scripts) helpful

Related

Jenkins plugin updates are unavailable

I have updated my jenkins server and see the following message for some plugins. I am not sure how to fix this. I looked at the dependencies section for that plugin and I see they are already installed. Not sure what else is missing so I can see the update available. Dependency for this is Mailer which is already installed on my server.
That is frustrating but you can try uploading plugins manually.
You can download plugins from here link to plugin storage.
Of course you have to roughly see what version of the plugin goes with your jenkins version.
Once you downloaded 'proper' plugin version, you go to manage plugins, advanced tab and there you can upload the plugin file. After that restart jenkins and check changes. You should really go to manage plugins, updated plugin tab and update selected plugins...
It could be guess work, but I'm sure after a couple of guesses you'll get to the version of Jenkins you have.
You might need to upgrade jenkins.. here are all jenkins war files:
https://get.jenkins.io/war-stable/
Last but not least... don't try to fix all dependencies.. fix those you use, rest is optional.

Pointing Jenkins to Use Another Plugin Repository

Good afternoon,
As I understand Jenkins, if I need to install a plugin, it goes to Jenkins Plugins
The problem I have is Jenkins is installed on a closed network, it cannot access the internet. Is there a way I can download all of the plugins, place them on a web server on my local LAN, and have Jenkins reach out and download plugins as necessary? I could download everything and install one plugin at a time, but that seems a little tedious.
You could follow some or all of the instructions for setting up an artifactory mirror for the plugin repo.
It will need to be a http/https server and you will find that many plugins have a multitude of dependencies
The closed network problem:
You can take a cue from the Jenkins Docker install-plugins.sh approach ...
This script takes as input a list of plugins, and optionally versions (eg: $0 workflow-aggregator:2.6 pipeline-maven:3.6.5 job-dsl:1.70) and will download all the plugins and dependencies into a working directory.
Our approach is to create a file (under version control) and redirect that to the command line input (ie: install-plugins.sh $(< plugins.lst).
You can download from where you do have internet access and then place on your network, manually copying them to your ${JENKINS_HOME}/plugins directory and restart the instance.
The tedious list problem:
If you only specify top-level plugins (ie: what you need), every time you run the script, it will resolve the latest dependencies. Makes for a short list, but random dependencies if they get updated at https://updates.jenkins.io. You can use a two-step approach to address this. Use the short-list to download the required plugins and dependencies. Store the generated explicit list for future reference or repeatability.

Jenkins install plugins offline

Installed Jenkins on a Linux server and want to install some plugins manually.
I want to install Blue Ocean and Artifactory.
For both plugins I downloaded the hpi file and tried to install it, but I get a lot of dependency errors.
Do I now have to install those dependencies manually as well? or is there a better way to do this?
I tried to install one of those dependency and that one also had some dependency errors as well :-(
The Linux server is not able to access the internet.
Thanks!
Robert
You are correct that BlueOcean has a lot of dependencies.
Given you are not able to connect to the internet you will need to download all 21 BlueOcean related hpi files and upload them from the Manage Jenkins > Manage Plugins > Advanced tab.
Alternatively, if you have access to the server that your Jenkins instance is running on you can copy the hpi files into the %JENKINS_HOME%/plugins folder. The corresponding directories (exploded from the hpi, which is just a zip file) will be created on Jenkins restart.
The easiest way to acquire all 21 plugin files is to open The Jenkins plugin page and search for blueocean. Download the same numbered version of all 21 and upload them one by one. Order shouldn't be an issue. As long as they are all present on restart the dependencies will resolve.
Same process goes for any other plugin. If you're able to get the machine connected to the internet it will make the process a lot simpler as you will be able to use the update center, which manages dependencies and update notifications.
Same case here. Our Jenkins is setup in OpenShift which is not allowed to connect to the Internet. Downloading a plugin 1-by-1 is tiresome. Not to mention that each plugins have its own dependencies that needs to be downloaded as well.
Here's what you would do...
Run a Jenkins locally in a machine that can download plugins.
Download and update all the plugins you want using the Update Center.
Go %JENKINS_HOME%/plugins directory. Inside this folder you would see *.jpi. These are your plugins. Its dependencies will be downloaded as well.
Rename it to *.hpi then keep it in some directory.
To test...
In your local Jenkins delete everything in %JENKINS_HOME%/plugins directory then put all *.hpi in this directory.
Restart your local Jenkins.
Verify if the plugins you require are installed and updated.

What is difference between .hpi and .jpi of Jenkins plugins?

I have installed Jenkins plugins in two ways i.e. manually keeping the .hpi file in Jenkins home directory, and installing from Jenkins front-end (Manage Jenkins > Manage Plugins).
What I notice here is when I install the plugin manually (downloaded as .hpi file) it installed with extension .hpi and while installing the plugin through Jenkins front-end I notice that plugin again installed as .jpi.
But why? What is going on in the background? I know functionality won't change but it looks interesting to know.
Both are supposed to be identical to that extend that Jenkins is renaming hpi to jpi when you install it manually as you said.
The reason why you see both in your JENKINS_HOME is the order in which plugins are loaded when Jenkins boots up: plugin.jpi gets precedence over plugin.hpi in case both are present. This is the way the upload installation makes sure the uploaded version will override the existing one after the restart.
Well I think its because Jenkins forked from Hudson so that is the 'H' in hpi. The J is obviously a change to that.
In terms of technology, the jpi plugins are generated using the gradle plugin architecture and hpi plugins are generated with the Maven architecture
Ultimately, as you have found both produce plugins which Jenkins can use. The vast majority are built using Maven but I am a fan of Gradle as it links nicely in with developing plugins in Groovy. You can also build in Groovy using Maven
Plugins as present in $JENKINS_HOME/plugins/ should always be using the .jpi suffix (with the basename being the plugin identifier). Normally Jenkins will enforce this naming pattern even when uploading a plugin manually, regardless of what filename you used for the upload, so I am not sure how you came to have a *.hpi file here, unless you directly copied it into this filesystem location.

Updating jenkins plugin from source

I currently have Build User Vars Plugin 1.1 installed in my Jenkins. Since version 1.1 of the plugin, there has been some important changes to the plugin code, and I want to pick them up. The question is what is the least amount of work to package up the hpi/jpi file that I can push on my Jenkins install that will contain latest changes.
It's fairly easy to build a plugin locally; you can then upload the hpi/jpi file to Jenkins via the Advanced tab in the plugin manager.
See the Jenkins plugin tutorial for detailed steps.

Resources