Skip to content

Commit 7e6882c

Browse files
authored
Update Jenkinsfile
Fixing error with test app builds in case when PR is done from a fork and the commit hash is not visible in test app build
1 parent e4a40cd commit 7e6882c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Jenkinsfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ def toolchains = [
1414
GCC_ARM: "arm-none-eabi-gcc"
1515
]
1616

17+
// mbed.getCurrentBranch returns either local branch name or reference to pull request
18+
def currentBranch = mbed.getCurrentBranch()
19+
1720
// Create a map of predefined build steps
1821
def parallelSteps = mbed.createParalleSteps("mbed-os", targets, toolchains)
1922

@@ -25,5 +28,5 @@ def testApps = [
2528
"mbed-client-testapp"
2629
]
2730

28-
// buildTestApps accepts array of test application names and a mbed-os commit hash as parameters
29-
mbed.buildTestApps(testApps, "${env.GIT_REVISION}")
31+
// buildTestApps accepts array of test application names and a mbed-os branch or PR reference as parameters
32+
mbed.buildTestApps(testApps, "${currentBranch}")

0 commit comments

Comments
 (0)