forked from aionnetwork/AVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (55 loc) · 1.66 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
properties([[$class: 'jenkins.model.BuildDiscarderProperty', strategy:
[$class: 'LogRotator', numToKeepStr: '50', artifactNumToKeepStr: '10']
]])
pipeline {
agent any
environment {
JAVA_HOME = "${env.JAVA_HOME}"
ANT_HOME = "${env.ANT_HOME}"
SYSTEM_TESTS_HOME = "test"
GIT_BRANCH = "${env.BRANCH_NAME}"
PATH = "${JAVA_HOME}:${JAVA_HOME}/bin:${PATH}"
}
stages {
stage('Build') {
steps {
echo "Building branch: ${env.BRANCH_NAME}"
sh "export JAVA_HOME"
echo "JAVA_HOME: ${JAVA_HOME}"
sh "export PATH"
echo "PATH: ${PATH}"
sh "ant"
}
}
stage('Unit test') {
steps {
timeout(30) {
sh "ant test"
}
}
}
stage('Archive build output') {
when {
expression {
GIT_BRANCH == 'master'
}
}
steps {
sh "ant package"
archiveArtifacts artifacts: 'embedding/*.jar'
}
}
}
post {
success {
slackSend channel: '#ci',
color: 'good',
message: "The pipeline ${currentBuild.fullDisplayName} completed successfully. Grab the generated builds at ${env.BUILD_URL}"
}
failure {
slackSend channel: '#ci',
color: 'danger',
message: "The pipeline ${currentBuild.fullDisplayName} failed at ${env.BUILD_URL}"
}
}
}