@@ -3,21 +3,34 @@ package com.sap.piper
3
3
@Singleton
4
4
class StageNameProvider implements Serializable {
5
5
static final long serialVersionUID = 1L
6
+ static final String CENTRAL_BUILD = " Central Build" ;
7
+ static final String BUILD = " Build" ;
6
8
7
9
/* * Stores a feature toggle for defaulting to technical names in stages */
8
10
boolean useTechnicalStageNames = false
9
11
10
12
String getStageName (Script script , Map parameters , Script step ) {
13
+ String stageName = null
11
14
if (parameters. stageName in CharSequence ) {
12
- return parameters. stageName
15
+ stageName = parameters. stageName
16
+ stageName = replaceCentralBuild(stageName);
17
+ return stageName
13
18
}
14
19
if (this . useTechnicalStageNames) {
15
20
String technicalStageName = getTechnicalStageName(step)
16
21
if (technicalStageName) {
17
22
return technicalStageName
18
23
}
19
24
}
20
- return script. env. STAGE_NAME
25
+ if (stageName == null ) {
26
+ stageName = script. env. STAGE_NAME
27
+ stageName = replaceCentralBuild(stageName);
28
+ }
29
+ return stageName
30
+ }
31
+
32
+ private String replaceCentralBuild (String stageName ) {
33
+ return CENTRAL_BUILD . equals(stageName) ? BUILD : stageName;
21
34
}
22
35
23
36
static String getTechnicalStageName (Script step ) {
0 commit comments