Hello everyone,
I saw that the jenkins-plugin-manager-tool is used to manage plugins via the CLI, but what if I want to use the UI? I am currently trying to write an ansible playbook to setup a basic jenkins instance with a predefined update repo but the provided environment variables like JENKINS_UC and JENKINS_UC_CREDENTIALS are only passed to the jenkins container itself for the plugin-manager cli. But the java process running jenkins is not using it.
Is there a way of changing the default repo URL with basic auth?
I was hoping to manage plugins via API calls instead of plugins.yml or txt files.
If I would use casc to configure the URL, do I need a plugin for using casc?
The update site url is managed in the file JENKINS_HOME/hudson.model.UpdateCenter.xml There you can have multiple update site urls. So you can manage that file in ansible.
Afaik there is no way for the built-in updatesite manager to use credentials. Don’t know if it would work to use a url with auth https://user:pass@url
If that doesn’t work you would need to write a plugin that allows to configure an update site with credentials
If you want to use casc to configure jenkins you need the plugin Configuration as Code
Using rest api calls has the big disadvantage that when you update a plugin you need to restart Jenkins. When you use the cli tool you basically update the plugin before Jenkins starts which is much better for a casc setup
Thx for replying.
I remember plugins being the worst to manage due to their dependencies.
Currently coworkers in my team manage plugins with ansible, but kinda overcomplicated.
If I’d use the cli to install the plugins, does it resolve the dependencies of specific plugins automatically?
What’s the best approach to pass the list of plugins to the cli?
Because I wonder how granular I have to track plugins and versions.
I am using podman and ideally would just need to update the container image version and the update center automatically provides the suited plugins for the current jenkins version.
the cli accepts a plain text file, one plugin per line with or without version
It will take care to install all required dependencies normally. Best to read the docs (GitHub - jenkinsci/plugin-installation-manager-tool: Plugin Manager CLI tool for Jenkins · GitHub) try things out to see how it exactly works