Move location of build history, separate from config

已查看 182 次
跳至第一个未读帖子

Gastro Man

未读,
2017年3月9日 16:37:592017/3/9
收件人 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

未读,
2017年3月10日 22:24:052017/3/10
收件人 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

未读,
2017年3月29日 09:47:202017/3/29
收件人 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

未读,
2021年6月11日 15:02:072021/6/11
收件人 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?

回复全部
回复作者
转发
0 个新帖子