-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
30 lines (25 loc) · 892 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
node {
env.JAVA_HOME="${tool 'jdk-oracle-8'}"
env.PATH="${env.JAVA_HOME}/bin:${env.PATH}"
try {
stage('Clone') {
checkout scm
}
withMaven(maven: 'M3', jdk: 'jdk-oracle-8', options: [artifactsPublisher(disabled: true)] ) {
stage('Packaging') {
sh "mvn package"
}
stage('Deploy') {
if (env.BRANCH_NAME == "master") {
sh "mvn -DskipTests deploy"
}
}
}
if (currentBuild.previousBuild.result == "FAILURE") {
slackSend (color: '#5cb85c', message: "BUILD BACK TO NORMAL: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>")
}
} catch (e) {
slackSend (color: '#d9534f', message: "FAILED: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>")
throw e
}
}