Where does Jenkins store configuration files for the jobs it runs?
Jenkins stores some of the related builds data like the following:
-
The working directory is stored in the directory
{JENKINS_HOME}/workspace/
.- Each job store its related temporal workspace folder in the directory
{JENKINS_HOME}/workspace/{JOBNAME}
- Each job store its related temporal workspace folder in the directory
-
The configuration for all jobs stored in the directory
{JENKINS_HOME}/jobs/
.-
Each job store its related builds data in the directory
{JENKINS_HOME}/jobs/{JOBNAME}
-
Each job folder contains:
-
The job configuration file is
{JENKINS_HOME}/jobs/{JOBNAME}/config.xml
-
The job builds are stored in
{JENKINS_HOME}/jobs/{JOBNAME}/builds/
-
-
See the Jenkins documentation for a visual representation and further details.
JENKINS_HOME
+- config.xml (jenkins root configuration)
+- *.xml (other site-wide configuration files)
+- userContent (files in this directory will be served under your http://server/userContent/)
+- fingerprints (stores fingerprint records)
+- nodes (slave configurations)
+- plugins (stores plugins)
+- secrets (secretes needed when migrating credentials to other servers)
+- workspace (working directory for the version control system)
+- [JOBNAME] (sub directory for each job)
+- jobs
+- [JOBNAME] (sub directory for each job)
+- config.xml (job configuration file)
+- latest (symbolic link to the last successful build)
+- builds
+- [BUILD_ID] (for each build)
+- build.xml (build result summary)
+- log (log file)
+- changelog.xml (change log)
On Linux one can find the home directory of Jenkins looking for a file, that Jenkins' home contains, e.g.:
$ find / -name "config.xml" | grep "jenkins"
/var/lib/jenkins/config.xml
Jenkins 1.627, OS X 10.10.5
/Users/Shared/Jenkins/Home/jobs/{project_name}/config.xml
The best approach would be to keep your job configurations in a Jenkinsfile that live in source control.
For the sake of completeness:
macOS High Sierra, Jenkins 2.x, installation via Homebrew~/.jenkins/jobs/{project_name}/config.xml
Complete overview about jenkins home: https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins