HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Separate Jenkins config from build logs

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
logsjenkinsseparateconfigfrombuild

Problem

My JENKINS_HOME is (something like) /var/lib/jenkins

In there, there is jobs directory, in it a subdirectory for each job. In each job subdirectory, you have config.xml plus the builds subdirectory.

I would like to somehow separate my config.xml from the same file structure that contains builds so that I can check them in my version control but to not clutter its view by having all the build logs that each execution writes. If I change a job config, the corresponding config.xml is changed and I can (actually in a Jenkins job) check it in my version control automatically or if I change it manually in a text editor, it gets checked out and deployed. But I don't want the builds in the version management.

Is there a way to separate just the job configs from the build logs in the filesystem?

Solution

If you're interested in only backing up configs, try installing the SCM Sync Configuration Plugin. This plugin syncs with a repo each time you change either a job or the Jenkins configs, but does not keep builds.

SCM Sync Configuration Jenkins/Hudson plugin is aimed at 2 main features :

Keep sync'ed your config.xml (and other ressources) jenkins/hudson files with a SCM repository

Track changes (and author) made on every file with commit messages

As a bonus you can set it to take a commit message each time you change a job, for easier restoration if necessary.

Context

StackExchange DevOps Q#1828, answer score: 4

Revisions (0)

No revisions yet.