Shared+workspace+plugin
官网: https://wiki.jenkins-ci.org/display/JENKINS/Shared+workspace+plugin
This plugin allows to share workspaces by Jenkins jobs with the same SCM repos.
It should save you some disk space, if you have different jobs with identical repos.
How to use it:
In "Manage Jenkins"->"Configure System" find new "Workspace Sharing" block
Add some Name + SCM Repo URL pairs. Save.
Go to the job configuration page, now you able to select "Shared Workspace" here.
Use ${SHAREDSPACE_SCM_URL} variable in your SCM url field.
Workspaces will be created as {node remote FS root}/sharedspace/{workspace name}
Known issues:
- SCM polling not working for now, plugin should be improved.
- sometimes, on fresh copied job, shared-space url parameter not saving to config on first "save", you should save job twice to be sure.
与Shared worspace plugin对应的xml配置文件是:
<JENKINS_HOME>/org.jenkinsci.plugins.sharedworkspace.SharedWorkspace.xml
多个job共用workspace:
共用SCM Repo URL,节省磁盘空间,节省SCM checkout/update时间,共享构建产物