JOB_WORKSPACE:就是构建时使用的目录,也就是从代码仓库中取得的代码所要保存的路径,默认路径为HUDSON_HOME/jobs/$jobname/workspace
job的配置中,所有涉及到路径的配置,都是基于JOB_WORKSPACE基础上的,配置时都是使用相对路径,也就是从这个路径开始计算。
可以在job设置中修改这个路径,找到Advanced Project Options,点击“Advanced”,勾选Use custom workspace,并设置一个绝对路径,比如/usr/local/hudson/jobname/workspace
点击保存,重新执行构建即可。
在job信息页中,可以点击“工作区”对JOB_WORKSPACE下的内容进行查看,如下。