Thanks for the suggestion!  I had thought of using external workspaces 
originally, but I want each job to have a unique workspace, but to pick an 
unused workspace when possible (since creating a new workspace is quite 
expensive in our case).  I didn't relish the idea of having to manage the 
lists of free and used workspaces myself.  I do like the fact there's no 
stashing required, though. :-)

craig

On Wednesday, September 6, 2017 at 2:26:49 PM UTC-7, Martin d'Anjou wrote:
>
> The External Workspace Manager Plugin 
> <https://wiki.jenkins.io/display/JENKINS/External+Workspace+Manager+Plugin> 
> can be used to solve this problem.
> I use it every day. It saves time as there is no stashing required.
>
> Here is an example of reusing the workspace with two nodes in the same job:
>
> def extWorkspace = exwsAllocate 'diskpool1'
> node ('linux') {
>     exws (extWorkspace) { sh 'do stuff' }
> }
> node ('test') {
>   exws (extWorkspace) { sh 'more stuff' }
> }
>
>
> Two different jobs can also reuse the same workspace, again without stashing, 
> see this example 
> <https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/doc/PIPELINE_EXAMPLES.md#workspace-reuse-in-two-different-jobs>.
>  You will need the run selector plugin 
> <https://wiki.jenkins-ci.org/display/JENKINS/Run+Selector+Plugin> for this 
> case.
>
>
> If you need help to set it up, post your question here, I should be able to 
> help you.
>
>
> Martin
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b3f90e5f-3028-46bd-be92-6da9993fbeef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to