-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
89 lines (67 loc) · 3.19 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
#!/usr/bin/env groovy
pipeline {
options { buildDiscarder(logRotator(numToKeepStr: '10')) }
agent {
label 'map-jenkins'
}
stages {
stage('Init') {
steps {
echo "NODE_NAME = ${env.NODE_NAME}"
echo "Maven repo is " + mavenRepo()
}
}
stage('Build & Test') {
steps {
timestamps {
timeout(time: 3, unit: 'HOURS') {
sh "./gradlew -Dtest.ignoreFailures=true --continue --no-daemon --gradle-user-home " + gradleRepo() + " -Dmaven.repo.local=" + mavenRepo() + " clean build check -x :MAP-Agent:test -x :P2Protelis:test"
}
}
}
}
stage('Gather tool results') {
// any post build steps that can fail need to be here to ensure that the email is sent out in the end
steps {
// ignore spotbugs and checkstyle issues in some of the simulation applications
recordIssues \
filters: [excludePackage('com.bbn.map.hifi.apps.filestore.*'), \
excludePackage('com.bbn.map.FaceRecognition.*'),
excludePackage('com.bbn.map.TestingHarness.*'),
excludeFile('MAP-code/*')], \
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]], \
tools: [spotBugs(pattern: '**/build/reports/spotbugs/*.xml'), checkStyle(pattern: '**/build/reports/checkstyle/*.xml')]
junit testResults: "**/build/test-results/**/*.xml", keepLongStdio: false
recordIssues tool: taskScanner(excludePattern: 'gradle-repo/**,maven-repo/**,MAP-code/**', includePattern: '**/*.java,**/*.sh,**/*.py', highTags: 'FIXME,HACK', normalTags: 'TODO')
recordIssues tool: java()
}
}
stage('Archive artifacts') {
steps {
archiveArtifacts artifacts: '**/*.log,**/build/reports/**,**/build/test-results/**'
}
}
} // stages
post {
always {
emailext recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider']],
to: 'FILL-IN-EMAIL-ADDRESS',
subject: '$DEFAULT_SUBJECT',
body: '''${PROJECT_NAME} - Build # ${BUILD_NUMBER} - ${BUILD_STATUS}
Changes:
${CHANGES}
Failed Tests:
${FAILED_TESTS, onlyRegressions=false}
Check console output at ${BUILD_URL} to view the full results.
Tail of Log:
${BUILD_LOG, maxLines=50}
'''
} // always
} // post
} // pipeline
def gradleRepo() {
"${WORKSPACE}/gradle-repo"
}
def mavenRepo() {
"${WORKSPACE}/maven-repo"
}