forked from sovrin-foundation/sovrin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.nightly
130 lines (117 loc) · 4.53 KB
/
Jenkinsfile.nightly
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!groovy
@Library('[email protected]') _
String pkgName = 'sovrin'
String repoChannel = 'master'
String clientRepoChannel = null
Map serverEnv = [:]
Map clientEnv = [:]
String emailRecipients = params.INDY_NODE_RECIPIENTS ?: env.INDY_NODE_RECIPIENTS ?: ''
Boolean gatherLogs = (params.GATHER_LOGS ?: env.GATHER_LOGS) != 'false'
def localLib
def err
String scmRepoUrl
String scmSha1
try {
nodeWrapper('ubuntu') {
stage('Load local shared library') {
checkout scm
localLib = load 'build/pipeline.groovy'
scmRepoUrl = gitHelper.repoUrl()
scmSha1 = gitHelper.sha1()
}
stage("Get server env") {
serverEnv = localLib.resolveServerEnv(repoChannel)
echo "Server env: $serverEnv"
}
stage("Get client env") {
clientEnv = localLib.resolveClientEnv(serverEnv.sovtoken.src)
echo "Client env: $clientEnv"
clientRepoChannel = (clientEnv.libindy.ver == clientEnv.libindy.src) ? 'stable' : 'master'
}
}
localLib.systemTests {
delegate.repoChannel = repoChannel
sovrinVer = serverEnv.sovrin.ver
sovtokenfeesVer = serverEnv.sovtokenfees.ver
sovtokenVer = serverEnv.sovtoken.ver
indyNodeVer = serverEnv.indyNode.ver
indyPlenumVer = serverEnv.indyPlenum.ver
ursaVer = serverEnv.ursa.ver
pyzmqVer = serverEnv.pyzmq.ver
libsovtokenVer = clientEnv.libsovtoken.ver
libindyVer = clientEnv.libindy.ver
libindyPypiVer = clientEnv.libindy.pypi
testSchema = [
['test_ledger.py'],
['test_state_proof.py'],
['TestViewChangeSuite.py'],
['test_off_ledger_signature.py'],
['TestConsensusSuite.py', 'TestTAASuite.py'],
['test_roles.py', 'test_freshness.py', 'TestMultiSigSuite.py'],
['TestAuditSuite.py'],
['TestCatchUpSuite.py'],
['TestCatchUpSuiteExtended.py'],
// TODO might be groupped in parts once https://github.com/docker/docker-py/issues/2278 is resolved
['TestAuthMapAttribSuite.py'],
['TestAuthMapCredDefSuite.py'],
['TestAuthMapMiscSuite.py'],
['TestAuthMapNymSuite.py'],
['TestAuthMapPluginsSuite.py'],
['TestAuthMapRevocRegDefSuite.py'],
['TestAuthMapRevocRegEntrySuite.py'],
['TestAuthMapSchemaSuite.py'],
['TestAuthMapUpgradeSuite.py'],
['test_libsovtoken.py', 'TestFeesSuite.py'],
['TestAdHocSuite.py'],
['TestProductionSuite.py']
]
// Define the version of hyperledger/indy-test-automation to use
// - https://github.com/hyperledger/indy-test-automation/releases
testVersion = 'v0.8.46'
testVersionByTag = true
delegate.gatherLogs = gatherLogs
}
} catch(Exception _err) {
currentBuild.result = "FAILED"
err = _err
throw _err
} finally {
stage('Build result notification') {
String envVersions = [serverEnv.sovrin?.ver, serverEnv.sovtoken?.ver, serverEnv.indyNode?.ver].join(', ')
sendNotification.email {
to = emailRecipients
subject = "[${pkgName}][nightly] Build #${this.env.BUILD_NUMBER} ${err ? 'failed' : 'succeed'} for versions [$envVersions]"
body = """
|Build:
| Project: \$PROJECT_NAME
| Url: ${this.env.BUILD_URL}
| Number: ${this.env.BUILD_NUMBER}
|
|Source:
| Url: ${scmRepoUrl}/tree/${scmSha1}
|
|Environment:
| Server:
| channel: $repoChannel
| sovrin: ${serverEnv.sovrin}
| sovtoken: ${serverEnv.sovtoken}
| sovtokenfees: ${serverEnv.sovtokenfees}
| indy-node: ${serverEnv.indyNode}
| indy-plenum: ${serverEnv.indyPlenum}
| ursa: ${serverEnv.ursa}
| pyzmq: ${serverEnv.pyzmq}
| Client:
| channel: ${clientRepoChannel}
| libsovtoken: ${clientEnv.libsovtoken}
| libindy: ${clientEnv.libindy}
|
|Check console output at ${this.env.BUILD_URL}console to view the details.
""".stripMargin()
}
}
if (err) {
stage('Error dump') {
echo "Pipeline failed: $err"
}
}
}