forked from aionnetwork/aion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
80 lines (63 loc) · 1.71 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//configuration
properties([[$class: 'jenkins.model.BuildDiscarderProperty', strategy:
[$class: 'LogRotator', numToKeepStr: '100', artifactNumToKeepStr: '20']
]])
node {
echo "current branch: ${env.BRANCH_NAME}"
}
pipeline {
agent any
stages {
stage('Setup') {
steps {
sh "git submodule init"
sh "git submodule update --recursive --remote --merge"
sh "${env.ANT_HOME} pack_build"
timeout(60) {
sh "${env.ANT_HOME}"
}
}
}
stage('Archive build output') {
when {
expression { GIT_BRANCH == 'master' || GIT_BRANCH == 'dev' || GIT_BRANCH == 'ci' }
}
steps {
archiveArtifacts artifacts: 'pack/aion-v*.tar.bz2'
}
}
stage('Test') {
steps {
timeout(60){
sh "${env.ANT_HOME} ci_build"
}
}
post {
always {
junit "report/*"
}
}
}
}
post {
always {
cleanWs()
}
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}"
}
}
}
environment {
JAVA_HOME = "${env.JDK_9_HOME}"
ANT_HOME = "${env.ANT_HOME}"
SYSTEM_TESTS_HOME = "test"
GIT_BRANCH = "${env.BRANCH_NAME}"
}