mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
Split stages in different nodes
This commit is contained in:
parent
4b0e9eac1a
commit
a6f76c59a7
1 changed files with 15 additions and 5 deletions
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
@ -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 ?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue