0

Which tool should I be using in order to be able to control Jenkins plugins from a cli/script in such way that when I have a new installation (e.g. 2.164.3)?

For example, I want to type blueocean - 1.1.15 (older version then current for example) and it will download the dependencies for the given version without messing everything else?

As I see I shouldn't be using jenkins-cli, but https://github.com/jenkinsci/plugin-installation-manager-tool? If so can anyone provide a simple example for the scenario I have given as the documentation is short of simple/clear examples.

The already existing topics are not answering the question in 2020 and I can't solve my scenario with them.

1 Answer 1

1

Why not use Plugin installation manager tool?

Your alternative would be the install-plugins.sh referenced in the tool readme.md. You can explicitly list all plugins and versions or let it auto-resolve dependencies.

See also answer in S/O re:Jenkins plugins for old versions.

6
  • My biggest problem is that I find the implementation not so straightforward. That is why I asked both for confirmation and example.Still confirming is good enough for me to continue trying, I will try out again today, if it works, I will accept the answer, if I find problems with it I will continue to wait someone to provide an example. Thanks. Jun 2, 2020 at 8:28
  • when I do java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war -l, I don't get the start pack plugins listed. I have tried this: java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war --plugins blueocean:1.15.0, it failed for one plugin, but other than it has downloaded in a specific folder that has nothing to do to where my plugins are stored. So my expectations was to see the plugins in Jenkins, but there is nothing it it. Jun 2, 2020 at 13:42
  • I have tried: java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war --plugins blueocean:1.15.0, I get a bunch of plugins downloaded, one was unable to be downloaded and I get after no plugins in the default folder, that tool is not useful for me at this point. Jun 3, 2020 at 8:15
  • Update 4, after a lot of debugging it looks like there is some kind of a bug whenever there is a permissions issue on the default DL folder (it doesn't throw warning about it). I have created new one and changed to it and all was executed successfully, it looks like yesterday I had another bad luck due to the global outage of Jenkins. So, right now I only need to understand what I need to do with the downloaded JPI and if all works out as expected, this will be what I needed. Jun 3, 2020 at 10:18
  • Final update, it worked for what I want to do with: mkdir plugin-management-cli; cd plugin-management-cli; wget https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/plugin-management-parent-pom-1.0.2/jenkins-plugin-manager-1.0.2.jar; --plugin-download-directory cd ~/plugin-management-cli/plugins/ sudo chown -R jenkins:jenkins ./* sudo cp -R ./* /var/lib/jenkins/plugins sudo systemctl stop jenkins sudo systemctl status jenkins sudo systemctl start jenkins sudo systemctl status jenkins Jun 4, 2020 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.