-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
65 lines (58 loc) · 2.12 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
#!groovy
@Library('gsdk-shared-lib@master')
import groovy.json.JsonSlurper
def pipeline()
{
stage('Checkout matter_private and load Jenkinsfile')
{
node('buildNFS')
{
// ************************************************************************************
// Clone Matter repo, checkout corresponding branch, checkout matter_private submodule
// ************************************************************************************
checkout scm: [$class : 'GitSCM',
branches : scm.branches,
browser : [$class: 'Stash', repoUrl: 'https://stash.silabs.com/projects/WMN_TOOLS/repos/matter_extension/'],
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
extensions : [[$class: 'ScmName', name: 'matter_extension']],
userRemoteConfigs : scm.userRemoteConfigs]
sh """
git submodule update --init --checkout third_party/matter_private
"""
// Load metadata from the submodule
pipelineFunctions = load 'third_party/matter_private/jenkins/Jenkinsfile'
// export the NFS overlay
sh 'sudo exportfs -af'
}
}
}
def postFailure(e)
{
currentBuild.result = 'FAILURE'
}
def postAlways()
{
stage('Cleanup Overlays')
{
advanceStageMarker()
node('buildNFS')
{
// clean up the things that have been pushed to the overlay
sh '/srv/jenkins/createSuperOverlay.sh '+
'removebuildoverlay '+
buildOverlayDir
dir('/srv/jenkins/overlays/') {
sh 'rm -rf ' + advanceStageMarker.nfsOverlayWorkspaceRoot.replace('/mnt/nfs', '/srv/jenkins')
}
}
}
}
// TODO lock the repo resource?
try {
pipeline()
} catch (e) {
postFailure(e)
throw e
} finally {
postAlways()
}