Skip to content

Instantly share code, notes, and snippets.

@aheuermann
Created October 25, 2016 07:27
Show Gist options
  • Save aheuermann/f451a5b8875efabcab970ea1415a3852 to your computer and use it in GitHub Desktop.
Save aheuermann/f451a5b8875efabcab970ea1415a3852 to your computer and use it in GitHub Desktop.
Jenkins Pipeline Parallel Test Example
node {
stage('Preparation') { // for display purposes
// Get some code from a GitHub repository
git 'https://github.com/dotci-test/test1.git'
}
stage('Build') {
// Run the build
if (isUnix()) {
sh "'docker-compose' build --pull"
} else {
echo "unix only"
}
}
stage('Test') {
def steps = [:]
steps["golang"] = {
sh "'docker-compose' run -T golang sh -xc \"go version\""
}
steps["node"] = {
sh "'docker-compose' run -T node sh -xc \"node -v\""
}
steps["node2"] = {
sh "'docker-compose' run -T node2 sh -xc \"echo test2\""
}
parallel steps
}
}