This repository has been archived by the owner on Apr 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Jenkinsfile.cd
72 lines (59 loc) · 2.1 KB
/
Jenkinsfile.cd
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
#!groovy
@Library('SovrinHelpers') _
def name = 'indy-anoncreds'
def testUbuntu = {
try {
echo 'Ubuntu Test: Checkout csm'
checkout scm
helpers.shell('cp setup-charm.sh ci/setup-charm.sh')
helpers.shell('sed -ir s/sudo// ci/setup-charm.sh')
echo 'Ubuntu Test: Build docker image'
def testEnv = dockerHelpers.build(name)
testEnv.inside {
echo 'Ubuntu Test: Install dependencies'
testHelpers.installDeps(['pytest-asyncio'])
echo 'Ubuntu Test: Test'
testHelpers.testJunit()
}
}
finally {
echo 'Ubuntu Test: Cleanup'
step([$class: 'WsCleanup'])
}
}
def testWindows = {
echo 'TODO: Implement me'
}
def testWindowsNoDocker = {
try {
echo 'Windows No Docker Test: Checkout csm'
checkout scm
testHelpers.createVirtualEnvAndExecute({ python, pip ->
echo 'Windows No Docker Test: Install dependencies'
testHelpers.installDepsBat(python, pip, ['pytest-asyncio'])
echo 'Windows No Docker Test: Test'
testHelpers.testJunitBat(python, pip)
})
}
finally {
echo 'Windows No Docker 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"
}
def options = new TestAndPublishOptions()
options.setPrContexts(["ci/hyperledger-jenkins/pr-merge"])
testAndPublish(name, [ubuntu: [anoncreds: testUbuntu], windows: [anoncreds: testWindowsNoDocker], windowsNoDocker: [anoncreds: testWindowsNoDocker]], true, options, [ubuntu: buildDebUbuntu])