Move location of build history, separate from config

47 views
Skip to first unread message

Gastro Man

unread,
Mar 9, 2017, 4:37:59 PM3/9/17
to Jenkins Users
Is it possible to configure Jenkins so the jobs' build history is not contained in the same directory as the config.xml?

Ideally, I would prefer all the configs to be together in an area ("job_config" folder)  that I can put in source control, backup, quickly search and compare, and manage.

And then the gigabytes of data stored in histories could be in another location ("job_history" folder) where I don't care about source control, don't need to include when searching across configs, etc.
Possibly even store this on a separate storage device..

I find it frustrating to have the mixing of "control" and "data" inside every single job subfolder, but I haven't found a way around this so far.

Thanks
 


 

Christopher Orr

unread,
Mar 10, 2017, 10:24:05 PM3/10/17
to jenkins...@googlegroups.com
You could mark the "builds" subdirectories as ignored in source control?

Or if you go to Manage Jenkins > Configure System and click "Advanced"
at the top of the page, you'll be able to alter where build data is
stored ("Build Record Root Directory").

If you change this to "${JENKINS_HOME}/builds/${ITEM_FULLNAME}", for
example, then all of the build data will be stored there.

At this point, the only thing left in ${JENKINS_HOME}/jobs/<name> (i.e.
${ITEM_ROOTDIR}) will be the job config.xml, and the metadata about
build numbers and last success/failure symlinks etc..

Note that changing this value will not automagically migrate all of your
existing data to the new location you've specified.

Regards,
Chris

Gastro Man

unread,
Mar 29, 2017, 9:47:20 AM3/29/17
to Jenkins Users
Excellent!
Changing Build Record Root Directory in the system settings was exactly what I was hoping for.
I never noticed that was there, assuming the setting has been there all along..

My jobs folder is now a very managable size, containing pretty much just the config.xml files, next build number, and a few symbolic links.

Thanks!

Tim Black

unread,
Jun 11, 2021, 3:02:07 PMJun 11
to Jenkins Users
I'm curious, now that this config setting is gone, and now there is the "jenkins.model.Jenkins.buildsDir" system property, are you now using that to separate your jobs/ from your builds/?

We're using Jenkins CasC to manage all jenkins configuration, and are trying to implement a solution for backing up and restoring build history, to provide build history continuity across promotions of jenkins clusters across dev/test/staging/prod environments. The previous plan was just to backup the jobs/ dir (we're using restic to make external backups from a simple hourly cron job), but since CasC also writes to this area, I'm thinking that separating jobs/ from builds/ in this way would provide some insurance against unforeseen conflicts of these two mechanisms interfering with one another.

Thoughts?

Reply all
Reply to author
Forward
0 new messages