41 lines
560 B
Groovy
41 lines
560 B
Groovy
pipeline {
|
|
agent {
|
|
label 'maven'
|
|
}
|
|
|
|
options {
|
|
disableConcurrentBuilds()
|
|
}
|
|
|
|
|
|
stages{
|
|
stage('Build & Test'){
|
|
steps{
|
|
script{
|
|
container('java'){
|
|
sh 'mvn clean package test'
|
|
sleep time: 10, unit: 'MINUTES'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Only for demo'){
|
|
when {
|
|
allOf {
|
|
branch 'master'
|
|
}
|
|
}
|
|
steps{
|
|
echo 'only for demo'
|
|
}
|
|
}
|
|
}
|
|
|
|
post{
|
|
always{
|
|
junit 'target/surefire-reports/**/*.xml'
|
|
}
|
|
}
|
|
}
|