56 lines
1.0 KiB
Groovy
56 lines
1.0 KiB
Groovy
#!/usr/bin/env groovy
|
|
@Library('sd')_
|
|
def kubeLabel = getKubeLabel()
|
|
|
|
pipeline {
|
|
|
|
agent {
|
|
kubernetes {
|
|
label "${kubeLabel}"
|
|
cloud 'Kube mwdevel'
|
|
defaultContainer 'runner'
|
|
inheritFrom 'ci-template'
|
|
}
|
|
}
|
|
|
|
options {
|
|
timeout(time: 1, unit: 'HOURS')
|
|
buildDiscarder(logRotator(numToKeepStr: '5'))
|
|
}
|
|
|
|
triggers { cron('@daily') }
|
|
|
|
stages {
|
|
|
|
stage('deploy'){
|
|
steps {
|
|
container('runner'){
|
|
sh "mvn -U -B clean deploy"
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('result'){
|
|
steps {
|
|
script {
|
|
currentBuild.result = 'SUCCESS'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
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>)"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|