简体   繁体   中英

How can I clone git repo to specific path in Jenkins i.e. /var

While cloning the repo to Jenkins my Jenkins node go offline due to space constraints in /home/jenkins folder. Hence I need to clone the repo to other path instead of default Jenkins path. Can anyone please let me know how can I clone to specific path in Jenkins.

If you are using git plugin, that should give you the option to mention checkout directory for git clone. In Source code management section, under additional behaviours, there should be a option 'check out to a sub-directory' ( location might change depend on the plugin version). Setting this value will make the plugin to check out the repository into the folder relative to your workspace.

If you are looking to change your workspace also,you can set custom workspace.

For free style jobs,you should be able to set that from configuration UI. If you check advanced project option, there is a option for 'use custom workspace' and set the value. Or else you can check advanced option in build section and check if 'use custom workspace' option is there or not.

For pipeline jobs, you can try the ws instruction to set custom workspace. ws("C:\\jenkins") { echo "jenkins workspace" }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM