I am configuring Jenkins for the first time, have been a user of it until now.
I read the documentation and understand what "$WORKSPACE" means on the slave.
I had a misconception that by default the jobs on Jenkins Slave run in a unique directory per job inside the workspace directory. This doesnt seem to be the case.
How do I assign a unique directory per job run? Will Jenkins automatically cleanup this job run directory after its done?
So if you wish to change the Jenkins workspace, all you've do is change the path of your JENKINS_HOME. For slave nodes, specify the default workspace on the slave machine in the slave configuration under Manage Jenkins > Manage Nodes > > Configure > Remote FS root.
Build section. Click on Advanced button on the right side of the page. Check "Use custom workspace" Fill in the path to the desired folder.
By default jenkins runs from $WORKSPACE/JOB Name
; here WORKSPACE is defined in the node configuration. This could be changed by choosing Advance Project options
-> Use custom workspace
under your job configuration.
Regarding cleanup: Choose Build Environment
-> Delete workspace before build starts
under jobs configuration if you like to cleanup for each new job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With