Disable auto update of jenkins and jenkins plugins when restarting jenkins?

Each time I restart jenkins (running in kubernetes) it tries to automatically update all its plugins and usually it fails and I need to debug and update the plugins. Could be nice to better control/plan this.

The first time jenkins starts it will read the plugins I need from /plugins/plugins.txt and download to a PVC. After that when/if jenkins restarts it will check if plugins exits on the the PVC and just use those instead of re-downloading.

But for some reason jenkins still tries to update the plugins and usually fails because some broken changes have been introduced.

Based on:

I have tried to update the script that runs on jenkins startup to:

jenkins-plugin-cli --war "/usr/share/jenkins/jenkins.war" --plugin-file "/app-config/plugins.txt" --latest false --verbose

And an example of my plugin.txt file:

plugins:
  blueocean: "1.25.2"
  bouncycastle-api: "2.25"
  cobertura: "1.17"
  configuration-as-code: "1.55"
  git-parameter: "0.9.14"
  kubernetes: "1.30.11"
  kubernetes-credentials-provider: "0.20"
  multibranch-build-strategy-extension: "1.0.10"
  pipeline-utility-steps: "2.11.0"
  ssh-steps: "2.0.0"
  ssh-agent: "1.23"
  startup-trigger-plugin: "2.9.3"
  timestamper: "1.15"
  uno-choice: "2.5.7"

Any suggestions on how to disable auto update on jenkins restart??

Also ideally I would like to avoid micro-managing the plugin dependency tree and updating versions manually through trial and error by inspecting the log at startup like:

io.jenkins.tools.pluginmanager.impl.AggregatePluginPrerequisitesNotMetException: Plugin prerequisite not met:
Plugin timestamper:1.17 depends on antisamy-markup-formatter:2.7, but there is an older version defined on the top level - antisamy-markup-formatter:2.6
	at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:223)
	at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:172)

installPlugins: false

Yes I was looking at that but hoped I could fix this problem without having to rebuild the whole controller image each time a new plugin needs to be added - compared to storing them on a pvc and managing from values file.

But will give it a try, thanks!

Would you then still keep the explicit versions in the plugins.txt file that is being read during the docker build?

I’m just telling you how to disable the helm chart installing things. if you have a PVC mounted for jenkins home, you don’t need to reinstall each time.

GitHub - jenkinsci/plugin-installation-manager-tool: Plugin Manager CLI tool for Jenkins will have all the details, but you don’t need to specify versions, you can just specify plugins and it’ll grab the latest version each build.

Or, you could have explicit versions, make sure your exact image is rebuildable each time, and use renovate to trigger updates to your plugins.txt files

There’s really no right way

1 Like