forked from hyperledger/indy-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.nightly
73 lines (64 loc) · 2.27 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
#!groovy
@Library('[email protected]') _
String pkgName = 'indy-node'
String mainModuleName = 'indy_node'
String emailRecipients = params.INDY_NODE_RECIPIENTS ?: env.INDY_NODE_RECIPIENTS ?: ''
def localLib
def err
String buildPkgVersion
String buildSrcVersion
String scmRepoUrl
String scmSha1
try {
nodeWrapper('ubuntu') {
stage('Resolve version to build') {
docker.image('hyperledger/indy-core-baseci:0.0.3-master').inside('-u 0') {
sh "apt-get update && apt-get install -y $pkgName"
releaseVersion = getReleaseVersion(mainModuleName, false)
buildPkgVersion = "${releaseVersion.release}~${releaseVersion.pre}${releaseVersion.revision}"
buildSrcVersion = sh(returnStdout: true, script: """
python3 -c "from $mainModuleName import load_manifest; print(load_manifest()['sha1'])"
""").trim()
}
echo "Version to build: buildSrcVersion=$buildSrcVersion, buildPkgVersion=$buildPkgVersion"
}
stage('Load local shared library') {
checkout scm
localLib = load 'ci/pipeline.groovy'
scmRepoUrl = gitHelper.repoUrl()
scmSha1 = gitHelper.sha1()
}
}
localLib.systemTests {
repoChannel = 'master'
pkgVersion = buildPkgVersion
srcVersion = buildSrcVersion
testSchema = [
['test_ledger.py'],
['test_vc.py'],
['test_consensus.py', 'TestTAASuite.py'],
['test_upgrade.py', 'test_roles.py', 'test_freshness.py', 'TestMultiSigSuite.py'],
['TestAuditSuite.py'],
['TestAuthMapSuite.py']
]
testVersion = 'v0.8.4'
testVersionByTag = true
}
} catch(Exception _err) {
currentBuild.result = "FAILED"
err = _err
throw _err
} finally {
stage('Build result notification') {
sendNotification.email {
to = emailRecipients
subject = "[${pkgName}][nightly] Build #${this.env.BUILD_NUMBER} ${err ? 'failed' : 'succeed'} for version ${buildPkgVersion} (${buildSrcVersion})"
srcUrl = "${scmRepoUrl}/tree/${scmSha1}"
}
}
if (err) {
stage('Error dump') {
echo "Pipeline failed: $err"
}
}
}