Split stages in different nodes

This commit is contained in:
Michaël Pailloncy 2017-03-06 17:27:26 +01:00
parent 4b0e9eac1a
commit a6f76c59a7

20
Jenkinsfile vendored
View file

@ -1,6 +1,6 @@
pipeline { pipeline {
agent { label "build" } agent any
tools { tools {
maven "M3" maven "M3"
@ -15,6 +15,7 @@ pipeline {
} }
stage("build") { stage("build") {
agent { label: "build" }
steps { steps {
sh "mvn clean package" sh "mvn clean package"
} }
@ -22,7 +23,8 @@ pipeline {
always { always {
archive "target/*.jar" archive "target/*.jar"
junit 'target/surefire-reports/*.xml' junit 'target/surefire-reports/*.xml'
stash includes:"target/*.jar", name: "binary" stash includes: "**", name: "sources"
stash includes: "target/*.jar", name: "binary"
} }
} }
} }
@ -31,20 +33,28 @@ pipeline {
steps { steps {
parallel ( parallel (
"static-analysis" : { "static-analysis" : {
withSonarQubeEnv('sonarqube') { node("build") {
sh 'mvn sonar:sonar' unstash "sources"
withSonarQubeEnv('sonarqube') {
sh 'mvn sonar:sonar'
}
} }
}, },
"performance-tests": { "performance-tests": {
echo "performance tests" node("build") {
echo "performance tests"
sleep 20
}
} }
) )
} }
} }
stage("deploy") { stage("deploy") {
agent { label "ssh" }
steps { steps {
unstash name:"binary" unstash name:"binary"
sh "ls -rtl target/"
input "Deploy ?" input "Deploy ?"
} }
} }