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 df6c0a3b9a
commit 0a09b141df
1 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env groovy #!/usr/bin/env groovy
library 'status-jenkins-lib@v1.7.13' library 'status-jenkins-lib@v1.8.0'
pipeline { pipeline {
@ -75,6 +75,7 @@ pipeline {
stages { stages {
stage('Setup') { stage('Setup') {
steps { script { steps { script {
currentBuild.displayName = getNewBuildName()
sh 'pip3 install --user -r requirements.txt' sh 'pip3 install --user -r requirements.txt'
} } } }
} }
@ -157,3 +158,15 @@ pipeline {
cleanup { cleanWs() } 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)
}
}