Couple of approaches:
You could use the External Workspace Manager plugin: https://jenkins.io/doc/pipeline/steps/external-workspace-manager/
Or as Robert suggested use the ws(){} block, this should give a guarantee on the workspace but you’ll need to confirm that you’re not about to fill up your node’s disks with old workspaces:
Something along the lines of:
def sharedWorkspace = “/shared-workspace/${JOB_NAME}/${BUILD_NUMBER}”
node(‘A’){
ws(sharedWorkspace){
//do stuff
}
}
node(‘B’){}
node(‘A’){
ws(sharedWorkspace){
//do more stuff
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f43a48c1-15bd-4feb-9a91-3e818a3cf268%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/60f2e5ee-df59-4785-a7ed-2e5a656aa861%40googlegroups.com.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2ca95dc7-20f3-385e-bf87-c88dd8888ef5%40gmail.com.