Reputation: 6362
I know that Jenkins stores the configuration for each job within an eponymous directory in jobs/. The job configuration file is config.xml
question is where does it save Plugins cofiguration?
i.e I have an some SCM plugin with general configuration, I want to copy the job configuration to other server (and do NOT want to use a dedicated plugin for doing so, simply looking for a configuration file)
Upvotes: 6
Views: 12256
Reputation: 305
Probably it depends on Jenkins version. I was searching for those xml files and found them in $HOME/.jenkins
folder for a plain install of Jenkins in Ubuntu, and in /var/jenkins_home
folder inside the jenkins/jenkins docker image. I have Jenkins 2.309.
I came across this by trying to set up the Locale plugin to use en_US and ignore browser settings. It seems that this plugin does not expose interface towards the configuration-as-code plugin. So you can not automate the settings of Locale plugin by using a Dockerfile and injecting CASC_JENKINS_CONFIG variable and a yaml file.
I solved this by first setting the Locale plugin in a Jenkins session, copy out the locale.xml file, then provide this file for docker build and instuct to copy this file in the Dockerfile like COPY locale.xml /var/jenkins_home/locale.xml
Upvotes: 0
Reputation: 37630
A simple search in Jenkins' home directory reveals the following .xml
files in my case, which contain the settings made in Manage Jenkins > Global Configuration:
/var/lib/jenkins# ls *.xml
com.smartcodeltd.jenkinsci.plugins.buildmonitor.BuildMonitorView.xml
config.xml
credentials.xml
gerrit-trigger.xml
github-plugin-configuration.xml
hudson.maven.MavenModuleSet.xml
hudson.model.UpdateCenter.xml
hudson.plugins.analysis.core.GlobalSettings.xml
hudson.plugins.ansicolor.AnsiColorBuildWrapper.xml
hudson.plugins.git.GitSCM.xml
hudson.plugins.git.GitTool.xml
hudson.plugins.piwik.PiwikAnalyticsPageDecorator.xml
hudson.plugins.warnings.WarningsPublisher.xml
hudson.scm.CVSSCM.xml
hudson.scm.SubversionSCM.xml
hudson.tasks.Ant.xml
hudson.tasks.Mailer.xml
hudson.tasks.Maven.xml
hudson.tasks.Shell.xml
hudson.triggers.SCMTrigger.xml
javaposse.jobdsl.plugin.ExecuteDslScripts.xml
jenkins.advancedqueue.PriorityConfiguration.xml
jenkins.advancedqueue.PrioritySorterConfiguration.xml
jenkins.model.ArtifactManagerConfiguration.xml
jenkins.model.DownloadSettings.xml
jenkins.model.JenkinsLocationConfiguration.xml
jenkins.mvn.GlobalMavenConfig.xml
jenkins.plugins.slack.SlackNotifier.xml
jenkins.plugins.slack.webhook.GlobalConfig.xml
jenkins.security.QueueItemAuthenticatorConfiguration.xml
nodeMonitors.xml
org.jenkinsci.plugins.gitclient.JGitTool.xml
org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.xml
org.jenkinsci.plugins.workflow.flow.FlowExecutionList.xml
org.jenkinsci.plugins.workflow.support.steps.StageStep.xml
You should be able to find the other plugin's options also there.
Upvotes: 5