¯\_(ツ)_/¯

thunder@home:~$

This is my home blog, mostly to share some useful info or code snippets
~ 1 min

Heya, Jenkins lovers.

Today we’re going to talk about great Jenkins Plugin: JobConfigHistory and its history.

Some time ago I faced some performance issues on my Jenkins and Jenkins’ home directory weight. While checking what could cause this, I found that ${JENKINS_HOME}/config-history/nodes has over 100000 files.

JobConfigHistory Plugin is a plugin designed to maintain the history of what has changed in the Jenkins job configuration and the system configuration. When a save operation is performed in Jenkins, then the history of what was changed (diff) and who made the changes (user) is saved. It could be a manual save from the UI or a programmatic save.

Most of builds running on our Docker Hub in containers. JobConfigHistory keep all configuration for all containers in files in that directory. All container based runs also has its configuration changes kept in that directory. If node was deleted, configuration file name contains deleted:

...
docker-agent-123a10i5pqvpb_deleted_20190316_121039_074
...

So, at some point we got dozens of files with docker containers as nodes.

To avoid this, we need to configure that plugin. Along with recommendations form this page, I’ve added excludes for my Docker nodes. Since all my Docker based nodes prefixed with docker-, it was quite easy to do. Just add to System configuration exclude file pattern this code |nodes/docker*/config\.xml and that’s it. So final string will look like the following:

queue\.xml|nodeMonitors\.xml|UpdateCenter\.xml|global-build-stats|OperationsCenterCredentialsProvider|LockableResourcesManager\.xml|MilestoneStep\.xml|nodes/docker*/config\.xml

Happy Jenkinsing!

Thank You For Reading