-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge in WMN_TOOLS/matter_extension from add_jenkinfile to main Squashed commit of the following: commit 85f869d65f1eaa80521dda474e1e2e263862202b Author: Sarthak Shaha <[email protected]> Date: Fri Sep 20 14:10:11 2024 -0400 added Jenkinsfile
- Loading branch information
1 parent
5ef85e4
commit 8bec7e7
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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() | ||
} |