-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
46 lines (39 loc) · 984 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env groovy
@Library('sd')_
def kubeLabel = getKubeLabel()
pipeline {
agent {
kubernetes {
label "${kubeLabel}"
cloud 'Kube mwdevel'
defaultContainer 'runner'
inheritFrom 'ci-template-java11'
}
}
options {
ansiColor('xterm')
buildDiscarder(logRotator(numToKeepStr: '5'))
timeout(time: 1, unit: 'HOURS')
timestamps()
}
triggers { cron('@daily') }
stages {
stage('package'){
steps {
sh 'mvn -B package'
}
}
}
post{
failure {
slackSend channel: '#iam', color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Failure (<${env.BUILD_URL}|Open>)"
}
changed {
script{
if('SUCCESS'.equals(currentBuild.currentResult)) {
slackSend channel: '#iam', color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Back to normal (<${env.BUILD_URL}|Open>)"
}
}
}
}
}