How change the mount point of the Jenkins home directory in Ubuntu
Опубликовано чт, 02/08/2018 - 11:37 пользователем MaximIf you need to change the mount point of the Jenkins home directory follow the instruction below:
- Stop Jenkins
/etc/init.d/jenkins stop
- Create folder for new Jenkins home directory
mkdir home
- Change access rights for this folder and all folders and files inside
sudo chown -R jenkins:jenkins home
- Find current Jenkins folder and copy all directories and files into new one. If you don't know current Jenkins directory you can find it in /etc/default/jenkins file. More details here.
sudo -u jenkins cp -r /var/lib/jenkins/* home/
- Change JENNIKS_HOME inside /etc/default/jenkins
sudo nano /etc/default/jenkins
find JENKINS_HOME and change path to new Jenkins home folder - Start Jenkins
/etc/init.d/jenkins start
- In case if you have the error message
Unable to create the home directory ‘/path/to/jenkins/home’. This is most likely a permission problem.
run the commandsudo chown -R jenkins:jenkins root_folder/
To get the root_folder you need go to Jenkins home folder and run pwd. This will work in case if you want use other one hdd (not system) for Jenkins home .$pwd
In my case the root_folder is media
/media/path/to/jenkins/home
That's all. Enjoy!