forked from melt-umn/copper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
57 lines (43 loc) · 1.68 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
#!groovy
library "github.com/melt-umn/jenkins-lib"
melt.setProperties(silverBase: false)
node {
try {
stage("Build") {
checkout scm
// -B Run in non-interactive (batch) mode
// -e Produce execution error messages
// -fae Only fail the build afterwards; allow all non-impacted builds to continue
// -Dmaven.test.failure.ignore=true Ignore test failures (We look at them with the junit command later)
sh "mvn clean verify -B -e -fae -Dmaven.test.failure.ignore=true"
// I decided to remove this.
// This means our cache is persistent, but also that it might grow unbounded, since nothing prunes it.
//def M2_REPO = pwd() + "/.m2repo"
// -Dmaven.repo.local=$M2_REPO Use a local maven repo instead of in the homedir.
junit allowEmptyResults: true, testResults:"**/target/*-reports/*.xml"
}
stage("Silver integration") {
// Test against the current silver 'develop' workspace that last successfully built:
// (We need scripts like 'deep-rebuild' so we can't use silver-latest.tar.gz.)
sh "rm -rf ./silver-latest || true"
sh "cp -r ${silver.SILVER_WORKSPACE} silver-latest"
sh "cp target/Copper*.jar silver-latest/jars/"
dir('silver-latest') {
sh "mkdir -p generated || true"
sh "./deep-rebuild"
}
// Common case: clean up if successful
sh "rm -rf ./silver-latest"
}
if (env.BRANCH_NAME == 'develop') {
stage("Deploy stable") {
sh "cp target/Copper*.jar ${melt.ARTIFACTS}/"
}
}
} catch(e) {
melt.handle(e)
} finally {
// August requests email notifications only for develop/master, not feature branches.
melt.notify(job: 'copper', ignoreBranches: true)
}
} // end node