@@ -86,7 +86,7 @@ func runAssemblePackages(config *abapEnvironmentAssemblePackagesOptions, com aba
8686 return nil , errConBuild
8787 }
8888
89- builds , err := executeBuilds (addonDescriptor , * connBuild , time .Duration (config .MaxRuntimeInMinutes )* time .Minute , time .Duration (config .PollIntervalsInMilliseconds )* time .Millisecond )
89+ builds , err := executeBuilds (addonDescriptor , * connBuild , time .Duration (config .MaxRuntimeInMinutes )* time .Minute , time .Duration (config .PollIntervalsInMilliseconds )* time .Millisecond , config . AlternativePhaseName )
9090 if err != nil {
9191 return builds , errors .Wrap (err , "Starting Builds for Repositories with reserved AAKaaS packages failed" )
9292 }
@@ -111,7 +111,7 @@ func runAssemblePackages(config *abapEnvironmentAssemblePackagesOptions, com aba
111111 return builds , nil
112112}
113113
114- func executeBuilds (addonDescriptor * abaputils.AddonDescriptor , conn abapbuild.Connector , maxRuntimeInMinutes time.Duration , pollInterval time.Duration ) ([]buildWithRepository , error ) {
114+ func executeBuilds (addonDescriptor * abaputils.AddonDescriptor , conn abapbuild.Connector , maxRuntimeInMinutes time.Duration , pollInterval time.Duration , altenativePhaseName string ) ([]buildWithRepository , error ) {
115115 var builds []buildWithRepository
116116
117117 for _ , repo := range addonDescriptor .Repositories {
@@ -125,7 +125,7 @@ func executeBuilds(addonDescriptor *abaputils.AddonDescriptor, conn abapbuild.Co
125125
126126 if repo .Status == "P" {
127127 buildRepo .repo .InBuildScope = true
128- err := buildRepo .start (addonDescriptor )
128+ err := buildRepo .start (addonDescriptor , altenativePhaseName )
129129 if err != nil {
130130 buildRepo .build .RunState = abapbuild .Failed
131131 buildRepo .repo .ErrorText = fmt .Sprint (err )
@@ -169,7 +169,7 @@ func (br *buildWithRepository) waitToBeFinished(maxRuntimeInMinutes time.Duratio
169169 }
170170}
171171
172- func (br * buildWithRepository ) start (addonDescriptor * abaputils.AddonDescriptor ) error {
172+ func (br * buildWithRepository ) start (addonDescriptor * abaputils.AddonDescriptor , altenativePhaseName string ) error {
173173 if br .repo .Name == "" || br .repo .Version == "" || br .repo .SpLevel == "" || br .repo .PackageType == "" || br .repo .PackageName == "" {
174174 return errors .New ("Parameters missing. Please provide software component name, version, sp-level, packagetype and packagename" )
175175 }
@@ -234,8 +234,15 @@ func (br *buildWithRepository) start(addonDescriptor *abaputils.AddonDescriptor)
234234 abapbuild.Value {ValueID : "ADDITIONAL_PIECELIST" ,
235235 Value : br .repo .AdditionalPiecelist })
236236 }
237- phase := "BUILD_" + br .repo .PackageType
238- log .Entry ().Infof ("Starting assembly of package %s" , br .repo .PackageName )
237+
238+ var phase string
239+ if altenativePhaseName != "" {
240+ phase = altenativePhaseName
241+ } else {
242+ phase = "BUILD_" + br .repo .PackageType
243+ }
244+
245+ log .Entry ().Infof ("Starting assembly of package %s as %s" , br .repo .PackageName , phase )
239246 return br .build .Start (phase , valuesInput )
240247}
241248
0 commit comments