Skip to content

Instantly share code, notes, and snippets.

@rsteckler
Created October 11, 2017 23:34
Show Gist options
  • Save rsteckler/2f5c8a5769c91107e8de881a7cf17df3 to your computer and use it in GitHub Desktop.
Save rsteckler/2f5c8a5769c91107e8de881a7cf17df3 to your computer and use it in GitHub Desktop.
Jenkins pipeline parallel stages in separate workspaces
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