-
Notifications
You must be signed in to change notification settings - Fork 18
/
Jenkinsfile
92 lines (89 loc) · 2.67 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
89
90
91
92
pipeline {
agent any
environment {
SBT_FLAGS = "-Dsbt.log.noformat=true"
}
stages {
stage('Cleaning') {
steps {
echo 'Cleaning...'
sh 'sbt ${SBT_FLAGS} clean'
}
}
stage('Formatting') {
steps {
echo 'Formatting...'
sh 'sbt ${SBT_FLAGS} format'
sh '''
echo "Modified files through scalariform:"
git diff
test -z "$(git ls-files -m)"
'''
}
}
stage('Building') {
steps {
echo 'Building...'
sh 'sbt ${SBT_FLAGS} compile'
}
}
stage('Testing') {
steps {
echo 'Testing...'
sh 'sbt ${SBT_FLAGS} coverage test coverageReport coverageAggregate'
}
}
stage('Documentation') {
steps {
echo 'Testing...'
sh 'sbt ${SBT_FLAGS} doc unidoc'
}
}
stage('User manual') {
steps {
echo 'Building user manual...'
sh 'sbt ${SBT_FLAGS} evalUserManual'
sh '''
echo "Modified files through evalUserManual:"
git diff
test -z "$(git ls-files -m)"
'''
}
}
stage('Packaging') {
steps {
echo 'Packaging...'
sh 'sbt ${SBT_FLAGS} releaseDist'
}
}
stage('Upload reports') {
steps {
withCredentials([string(credentialsId: 'codecov-token', variable: 'CODECOV_TOKEN')]) {
sh '''
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
'''
}
}
}
}
post {
fixed {
emailext (
subject: "FIXED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: "See <${env.BUILD_URL}>",
recipientProviders: [developers(), requestor()],
to: 'gapt-group@googlegroups.com'
)
}
failure {
emailext (
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: "See <${env.BUILD_URL}>\n\n------------------------------------------\n\${BUILD_LOG}",
recipientProviders: [developers(), requestor()],
to: 'gapt-group@googlegroups.com'
)
}
}
}