Access all workspaces for a job with concurrent builds

I have a job that runs concurrently on multiple slave nodes ie there are multiple workspace directories for this job - /home/jenkins/workspace/jobA , /home/jenkins/workspace/jobA@2 , /home/jenkins/workspace/jobA@3 etc.

I have been looking at this script which lets you clean up workspaces for a list of jobs on all the nodes - https://wiki.jenkins.io/display/JENKINS/Wipe+workspaces+for+a+set+of+jobs+on+all+nodes. However, upon testing, I realized that this only removed the directory /home/jenkins/workspace/jobA and did not catch those ending with @ .

The script retrieves the workspace path via workspacePath = node.getWorkspaceFor(item) . I have searched online to find an equivalent of this function to instead fetch a list of all workspace paths for a concurrent job but did not really find any info.. Not sure if I was looking in the wrong places or missed something.

Any help/pointers in this regard is greatly appreciated. Thanks!


AFAIK there is no such API currently; you would need to look for sibling folders ending in WorkspaceList.COMBINATOR plus a number.

链接地址: http://www.djcxy.com/p/66400.html

上一篇: NoSql速成课程/教程

下一篇: 使用并发构建访问所有工作空间以进行作业