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:
parent
9d2b9b547e
commit
4d6c90acb3
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.8.0'
|
||||
library 'status-jenkins-lib@v1.8.1'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
@ -178,6 +178,10 @@ def setNewBuildName() {
|
|||
|
||||
def setBuildDescFromFile(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')) {
|
||||
currentBuild.displayName = tokens.build.replace(/^pr/, 'PR-')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue