ci: fix filename parsing, add sane fallback (#296)

Depends on:
https://github.com/status-im/status-jenkins-lib/pull/79

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-11-10 14:00:52 +01:00 committed by GitHub
parent 9d2b9b547e
commit 4d6c90acb3
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env groovy #!/usr/bin/env groovy
library 'status-jenkins-lib@v1.8.0' library 'status-jenkins-lib@v1.8.1'
pipeline { pipeline {
@ -178,6 +178,10 @@ def setNewBuildName() {
def setBuildDescFromFile(fileNameOrPath) { def setBuildDescFromFile(fileNameOrPath) {
def tokens = utils.parseFilename(utils.baseName(fileNameOrPath)) def tokens = utils.parseFilename(utils.baseName(fileNameOrPath))
if (tokens == null) { /* Fallback for regex fail. */
currentBuild.description = utils.baseName(fileNameOrPath)
return
}
if (tokens.build.startsWith('pr')) { if (tokens.build.startsWith('pr')) {
currentBuild.displayName = tokens.build.replace(/^pr/, 'PR-') currentBuild.displayName = tokens.build.replace(/^pr/, 'PR-')
} }