Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirely different EC2 instance at any point. We have a bunch of Puppet manifests allowing us to easily reinstall the software on the EC2 instance, but custom configuration files, like the ones for the jobs I create in Jenkins, would be deleted after the move.

Now, if Jenkins stores what jobs are to be run on it in an XML file or set of XML files somewhere, I could set up a system where those files are committed to the version control server, and then downloaded back to a newly-created server as part of the puppet manifest. Does anyone know where these files are stored? I've tried copying /var/lib/jenkins/jobs, but that appears to store the output of Jenkins' jobs, not the input.

2 Answers

0 votes
by (50.2k points)

Jenkins stores the configuration for each job within an eponymous directory in jobs/. The job configuration file is config.xml, the builds are stored in builds/, and the working directory is workspace/.

For more information please refer:https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins

0 votes
by (1.7k points)

Your configuration files for jobs would go in the following folder path, in Jenkins

/information is stored under folders in this directory; each folder contains one or more 'config.xml', which is the configurations in that job. Such is what you would actually wish to back up into the version control, so when you make changes here such as settings, scripts and triggers.

1. Jenkins Job configurations can be backed up by copying /var/lib/jenkins/jobs and in this directory, include its "config.xml" for each.

2. Automating with Puppet Use your manifest in Puppet to create a script that will download all these 'config.xml' files from version control onto some new EC2 instance.

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...