Add Jenkinfile
parent
880f2c1b2c
commit
f6165aa617
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
pipeline {
|
||||
agent { label 'maven' }
|
||||
|
||||
options {
|
||||
timeout(time: 1, unit: 'HOURS')
|
||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||
}
|
||||
|
||||
triggers { cron('@daily') }
|
||||
|
||||
parameters {
|
||||
string(name: 'BRANCH', defaultValue: 'devel', description: '' )
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
stage('deploy'){
|
||||
steps {
|
||||
sh "mvn -U -B clean deploy"
|
||||
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>)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue