Skip to content

Commit

Permalink
Pull request #61: added Jenkinsfile
Browse files Browse the repository at this point in the history
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
Sarthak-Shaha committed Sep 20, 2024
1 parent 5ef85e4 commit 8bec7e7
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions Jenkinsfile
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()
}

0 comments on commit 8bec7e7

Please sign in to comment.