How do you manage plugins in a reproducible way?
IntermediateConceptPlugins, JCasC & Jenkins on Kubernetes
Answer
Pin plugins in plugins.txt and install them at image build time with jenkins-plugin-cli; never click "Install" on production.
# one plugin per line, name:version (exact versions come from the update center)
configuration-as-code:<pinned-version>
kubernetes:<pinned-version>
workflow-aggregator:<pinned-version>
FROM jenkins/jenkins:2.479.3-lts-jdk21
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt
Use jenkins-plugin-cli --available-updates --output txt to produce an updated list for a PR.
More on Plugins, JCasC & Jenkins on Kubernetes
What does `jenkins-plugin-cli` resolve for you, and what flags matter?IntermediateWhy should you keep the number of plugins low?BeginnerWhat is JCasC and how is it loaded?BeginnerWhat are the top-level root elements in a JCasC file?IntermediateHow do you inject secrets into JCasC without committing them?AdvancedHow do you configure authorization with JCasC?Intermediate