ci: update build name to be more descriptive

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-10-20 14:26:52 +02:00
parent 57e934fad5
commit 3ad2f3ff92
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 14 additions and 1 deletions

15
ci/Jenkinsfile vendored
View File

@ -1,5 +1,5 @@
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.13'
library 'status-jenkins-lib@v1.8.0'
pipeline {
@ -75,6 +75,7 @@ pipeline {
stages {
stage('Setup') {
steps { script {
currentBuild.displayName = getNewBuildName()
sh 'pip3 install --user -r requirements.txt'
} }
}
@ -157,3 +158,15 @@ pipeline {
cleanup { cleanWs() }
}
}
def getNewBuildName() {
/* For URLs we need to parse the filename to get attributes. */
if (params.BUILD_SOURCE.startsWith('http')) {
def tokens = utils.parseFilename(utils.baseName(params.BUILD_SOURCE))
return [
(tokens.tstamp ?: tokens.version), tokens.commit, tokens.build
].grep().join('-')
} else {
return utils.baseName(params.BUILD_SOURCE)
}
}