2017-09-26 14:25:33 +00:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
|
|
|
|
pipeline {
|
2019-07-05 04:53:07 +00:00
|
|
|
|
2023-07-12 17:36:41 +00:00
|
|
|
agent { label 'java11' }
|
2017-09-26 14:25:33 +00:00
|
|
|
|
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
|
|
|
buildDiscarder(logRotator(numToKeepStr: '5'))
|
|
|
|
}
|
|
|
|
|
|
|
|
triggers { cron('@daily') }
|
|
|
|
|
|
|
|
stages {
|
|
|
|
|
2023-07-12 17:36:41 +00:00
|
|
|
stage('deploy') {
|
2017-09-26 14:25:33 +00:00
|
|
|
steps {
|
2023-07-12 17:36:41 +00:00
|
|
|
sh "mvn -U -B clean deploy"
|
2017-12-06 09:58:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('result'){
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
currentBuild.result = 'SUCCESS'
|
|
|
|
}
|
2017-09-26 14:25:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
failure {
|
|
|
|
slackSend color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Failure (<${env.BUILD_URL}|Open>)"
|
|
|
|
}
|
|
|
|
|
|
|
|
changed {
|
|
|
|
script{
|
|
|
|
if('SUCCESS'.equals(currentBuild.result)) {
|
|
|
|
slackSend color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Back to normal (<${env.BUILD_URL}|Open>)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|