Skip to content

Commit

Permalink
pass stepName to maven utils for mavenBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
I557621 committed Jun 16, 2023
1 parent a57004b commit a4f99ae
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/mavenBuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
)

func mavenBuild(config mavenBuildOptions, telemetryData *telemetry.CustomData, commonPipelineEnvironment *mavenBuildCommonPipelineEnvironment) {
utils := maven.NewUtilsBundle()
utils := maven.NewUtilsBundle("mavenBuild")

err := runMavenBuild(&config, telemetryData, utils, commonPipelineEnvironment)
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions cmd/mavenExecuteIntegration.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ package cmd

import (
"fmt"
"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/maven"
"github.com/SAP/jenkins-library/pkg/telemetry"
"path/filepath"
"strconv"
"strings"
"unicode"

"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/maven"
"github.com/SAP/jenkins-library/pkg/telemetry"
)

func mavenExecuteIntegration(config mavenExecuteIntegrationOptions, _ *telemetry.CustomData) {
err := runMavenExecuteIntegration(&config, maven.NewUtilsBundle())
err := runMavenExecuteIntegration(&config, maven.NewUtilsBundle(""))
if err != nil {
log.Entry().WithError(err).Fatal("step execution failed")
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/mavenExecuteStaticCodeChecks.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package cmd

import (
"strconv"

"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/maven"
"github.com/SAP/jenkins-library/pkg/telemetry"
"strconv"
)

func mavenExecuteStaticCodeChecks(config mavenExecuteStaticCodeChecksOptions, telemetryData *telemetry.CustomData) {
err := runMavenStaticCodeChecks(&config, telemetryData, maven.NewUtilsBundle())
err := runMavenStaticCodeChecks(&config, telemetryData, maven.NewUtilsBundle(""))
if err != nil {
log.Entry().WithError(err).Fatal("step execution failed")
}
Expand Down
10 changes: 6 additions & 4 deletions pkg/maven/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ type utilsBundle struct {
*piperhttp.Client
}

func NewUtilsBundle() Utils {
func NewUtilsBundle(stepName string) Utils {
utils := utilsBundle{
Command: &command.Command{},
Files: &piperutils.Files{},
Client: &piperhttp.Client{},
Command: &command.Command{
StepName: stepName,
},
Files: &piperutils.Files{},
Client: &piperhttp.Client{},
}
utils.Stdout(log.Writer())
utils.Stderr(log.Writer())
Expand Down
2 changes: 1 addition & 1 deletion pkg/versioning/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (m *Maven) init() {
}

if m.utils == nil {
m.utils = maven.NewUtilsBundle()
m.utils = maven.NewUtilsBundle("")
}
}

Expand Down

0 comments on commit a4f99ae

Please sign in to comment.