forked from hyperledger/indy-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
70 lines (58 loc) · 2.08 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
#!groovy
@Library('SovrinHelpers') _
def name = 'indy-node'
def nodeTestUbuntu = {
try {
echo 'Ubuntu Test: Checkout csm'
checkout scm
echo 'Ubuntu Test: Build docker image'
def testEnv = dockerHelpers.build(name)
testEnv.inside('--network host') {
echo 'Ubuntu Test: Install dependencies'
testHelpers.install()
echo 'Ubuntu Test: Test'
testHelpers.testRunner([resFile: "test-result-node.${NODE_NAME}.txt", testDir: 'indy_node'])
//testHelpers.testJUnit(resFile: "test-result-node.${NODE_NAME}.xml")
}
}
finally {
echo 'Ubuntu Test: Cleanup'
step([$class: 'WsCleanup'])
}
}
def commonTestUbuntu = {
try {
echo 'Ubuntu Test: Checkout csm'
checkout scm
echo 'Ubuntu Test: Build docker image'
def testEnv = dockerHelpers.build(name)
testEnv.inside {
echo 'Ubuntu Test: Install dependencies'
testHelpers.install()
echo 'Ubuntu Test: Test'
testHelpers.testJUnit([resFile: "test-result-common.${NODE_NAME}.xml", testDir: 'indy_common'])
}
}
finally {
echo 'Ubuntu Test: Cleanup'
step([$class: 'WsCleanup'])
}
}
def buildDebUbuntu = { repoName, releaseVersion, sourcePath ->
def volumeName = "$name-deb-u1604"
if (env.BRANCH_NAME != '' && env.BRANCH_NAME != 'master') {
volumeName = "${volumeName}.${BRANCH_NAME}"
}
if (sh(script: "docker volume ls -q | grep -q '^$volumeName\$'", returnStatus: true) == 0) {
sh "docker volume rm $volumeName"
}
dir('build-scripts/ubuntu-1604') {
sh "./build-$name-docker.sh \"$sourcePath\" $releaseVersion $volumeName"
sh "./build-3rd-parties-docker.sh $volumeName"
}
return "$volumeName"
}
options = new TestAndPublishOptions()
options.enable([StagesEnum.PACK_RELEASE_COPY, StagesEnum.PACK_RELEASE_COPY_ST])
options.setCopyWithDeps(true)
testAndPublish(name, [ubuntu: [node: nodeTestUbuntu, common: commonTestUbuntu]], true, options, [ubuntu: buildDebUbuntu])