insert jenkins username when job is triggered
Change-Id: Ia0226726735a2519567314729d7cd4778334f942
diff --git a/lab-pipeline.groovy b/lab-pipeline.groovy
index f4a94c8..c0b58a9 100644
--- a/lab-pipeline.groovy
+++ b/lab-pipeline.groovy
@@ -63,7 +63,11 @@
if (HEAT_STACK_REUSE.toBoolean() == false) {
// Don't allow to set custom heat stack name
wrap([$class: 'BuildUser']) {
- HEAT_STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
+ if (env.BUILD_USER_ID) {
+ HEAT_STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
+ } else {
+ HEAT_STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
+ }
currentBuild.description = HEAT_STACK_NAME
}
}