Hi,
Given the following Jenkinsfile I would expect two different workspaces to be
printed but that is not the case. Am I doing something wrong?
def getWorkspace() {
path = "${WORKSPACE}"
sleep 1
return path
}
def build_steps = [:]
build_steps['first'] = {
node {
println getWorkspace()
}
}
build_steps['second'] = {
node {
println getWorkspace()
}
}
stage ('test') {
parallel build_steps
}
Console:
[Pipeline] stage
[Pipeline] { (test)
[Pipeline] parallel
[Pipeline] [first] { (Branch: first)
[Pipeline] [second] { (Branch: second)
[Pipeline] [first] node
[first] Running on agent1 in /home/jenkins/workspace/test
[Pipeline] [second] node
[Pipeline] [first] {
[second] Running on agent1 in /home/jenkins/workspace/test@2
[Pipeline] [second] {
[Pipeline] [first] sleep
[first] Sleeping for 1 sec
[Pipeline] [second] sleep
[second] Sleeping for 1 sec
[Pipeline] [first] echo
[first] /home/jenkins/workspace/test@2
[Pipeline] [first] }
[Pipeline] [first] // node
[Pipeline] [first] }
[Pipeline] [second] echo
[second] /home/jenkins/workspace/test@2
[Pipeline] [second] }
[Pipeline] [second] // node
[Pipeline] [second] }
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
Best regards
Rasmus
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/45AD173563CB774A9CAB490CA130883B036D9C74DF%40Exchange2010.kamstrup.dk.
For more options, visit https://groups.google.com/d/optout.