Hello.

Seems correct to me -- you are executing on the same node, there is no 
reason for it to be different within the same job. If you have multiple 
nodes you will have to stash / unstash to bring any files with you from 
previous step you have not published to an artifact repository like nexus 
or artifactory.

Regards,
-Björn


On Tuesday, 20 March 2018 15:29:10 UTC+1, Rasmus Uth Pedersen wrote:
>
> 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/39d54f2e-99a3-4f31-bed4-43f60f758391%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to