forked from aionnetwork/aion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
88 lines (75 loc) · 2.58 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
81
82
83
84
85
86
87
88
properties([[$class: 'jenkins.model.BuildDiscarderProperty', strategy:
[$class: 'LogRotator', numToKeepStr: '100', artifactNumToKeepStr: '20']
]])
pipeline {
agent any
stages {
stage('Build') {
steps {
echo "Building branch: ${env.BRANCH_NAME}"
sh "git lfs install"
sh "./gradlew pack"
}
}
stage('Archive build output') {
when {
expression {
GIT_BRANCH == 'master' ||
GIT_BRANCH == 'master-pre-merge'
}
}
steps {
archiveArtifacts artifacts: 'pack/aion-v*.tar.bz2'
}
}
stage('Unit test') {
steps {
timeout(60) {
sh "./gradlew ciBuild"
}
}
}
stage('Functional tests') {
when {
// only run if:
// - this branch is in a PR (env.CHANGE_ID not null), or
// - this branch is master or master-pre-merge
expression { env.CHANGE_ID || GIT_BRANCH == 'master' || GIT_BRANCH == 'master-pre-merge' }
}
steps {
dir('FunctionalTests') {
git url: 'https://github.com/aionnetwork/node_test_harness.git', branch: 'master'
}
sh('cp pack/aion.tar.bz2 FunctionalTests/Tests')
dir('FunctionalTests') {
sh('tar -C Tests -xjf Tests/aion.tar.bz2')
sh('./gradlew :Tests:ciTest -i')
}
}
}
}
post {
always {
sh('([ -d FunctionalTests ] && cp -r FunctionalTests/report/FunctionalTests report/) || true')
junit "report/**/*.xml"
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}"
DOCKER_HOST = "unix:///var/run/docker.sock"
}