3

I do a lot of testing in my Jenkins VM which I have on my local laptop. I found this time-consuming to remove Jenkins and installing again from scratch. It would be better if I have a simple way to restore my Jenkins.

Is there a way to remove all the plugins that I have installed manually and keep the plugins that were installed during Jenkins installation?

  • Why do you want that? – 030 Mar 8 '18 at 21:48
  • I don't think there is a universal "one-click" button to restore default plugins. You can however download and search through the jenkins.war file of the version you installed and see the exact plugins with their versions that are bundled with that version. – PrestonM Mar 8 '18 at 22:01
  • 1
    @030 I'm going to assume he is fed up with trying to figure out which plugins are causing him issues and wants to start from square 1 :) – PrestonM Mar 8 '18 at 22:01
  • @030 I do a lot of testing in my Jenkins VM which I have on my local laptop. I found it time-consuming to remove Jenkins and installing again from scratch. It would be better if I have a simple way to restore my Jenkins in a simple way. – Buvanesh Kumar Mar 9 '18 at 15:35
  • @030 I have added the same :) – Buvanesh Kumar Mar 9 '18 at 18:31
2

One could use ansible geerlingguy.jenkins role. When this role is applied, a Jenkins system will be created without any plugins. Subsequently, one could install plugins manually, but also define them in ansible, i.e. plugins as code.

1

One possible approach, although a bit tedious (and a bit dumb), would be to:

  • make a fresh Jenkins installation of the exact same version on another (maybe scrappable) machine
  • get the list of the (default) plugins it ends up with
  • add/remove/update the plugins in the original Jenkins installation to match that list
1

One could also use docker Jenkins LTS. If one wants to start from scratch, just remove the mounted Jenkins home folder and there will be a clean Jenkins in no time.

https://github.com/jenkinsci/docker/blob/master/README.md

  • Yup, I have used this procedure sometimes back, still using some cases. I'm just curious to know is there a native way of doing this. – Buvanesh Kumar Mar 9 '18 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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