I have 3 build jobs which run in parallel in a declarative jenkinsfile. They run in the same node and need to use the same workspace. The issue is the workspace which Jenkins refers for each stage, for example:
C:\UserData\Workspace \\Workspace for Job1
C:\UserData\Workspace@2 \\Workspace for Job2
C:\UserData\Workspace@3 \\Workspace for Job3
Jenkins appends '@2' and '@3' for the remaining 2 stages and hence there is a path issue and job fails. Can someone help me in resolving this issue?
My code is:
pipeline {
stages {
stage('Build') {
parallel {
stage('Job1') {
agent {
node {
label 'label1'
customWorkspace = "C:\UserData\Workspace"
}
}
stage('Job2') { ... similar code ... }
stage('Job3') { ... similar code ... }
}
}