How do i change default build directory (history)

Hi all,

I am having issue setting up build directory properly on my jenkins installation on kubernetes.
It defaults to /var/log${ITEM_ROOTDIR}/builds.
How do i update this.
I want to put builds in our share mount cifs /mnt/somedirectory/builds
I already mounted also. but not sure how to set jenkins. I am using jenkins helm chart.
THanks,

This is a Jenkins Features Controlled with System Properties:
jenkins.model.Jenkins.buildsDir

You must stop Jenkins and relocate the files, then set the system property and then start it back up.

Usage

System properties are defined by passing -Dproperty=value to the java command line to start Jenkins. Make sure to pass all of these arguments before the -jar argument, otherwise they will be ignored. Example:

java -Dhudson.footerURL=http://example.org -jar jenkins.war

Guidance is provided in the link above as to how to set the property and what to move.

You may find it faster (if preserving the same storage structure) to move the entire jobs directory and then move back the necessary configuration files (config.xml, nextBuildNumber, etc.) as it’s a lot smaller. A piped tar copy ($ tar cf - jobs | (cd /dest/dir; tar xvf -), followed by deleting the redundant files works for separate filesystems as well. You can also combine the tar with a find to replicate the specific builds files. Always have a backup before proceeding/deleting.