Created
October 11, 2017 23:34
-
-
Save rsteckler/2f5c8a5769c91107e8de881a7cf17df3 to your computer and use it in GitHub Desktop.
Jenkins pipeline parallel stages in separate workspaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
stages { | |
stage('first') { | |
parallel { | |
stage('firstA') { | |
steps { | |
ws('A') { | |
sh '''pwd | |
echo 1 > shared.txt | |
''' | |
} | |
} | |
} | |
stage('firstB') { | |
steps { | |
ws('B') { | |
sh '''pwd | |
echo 2 > shared.txt | |
''' | |
} | |
} | |
} | |
} | |
} | |
stage('second') { | |
parallel { | |
stage('secondA') { | |
steps { | |
ws('A') { | |
sh '''pwd | |
cat shared.txt | |
''' | |
} | |
} | |
} | |
stage('secondB') { | |
steps { | |
ws('B') { | |
sh '''pwd | |
cat shared.txt | |
''' | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment