Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MTA build for detectExecuteScan step #4876

Merged
merged 18 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions cmd/detectExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ func runDetect(ctx context.Context, config detectExecuteScanOptions, utils detec
}
}

// for MTA
if config.BuildMTA {
log.Entry().Infof("running MTA Build")
mtaConfig := setMTAConfig(config)
mtaUtils := newMtaBuildUtilsBundle()

err := runMtaBuild(mtaConfig, &mtaBuildCommonPipelineEnvironment{}, mtaUtils)
if err != nil {
return err
}
}

blackduckSystem := newBlackduckSystem(config)

args := []string{"./detect.sh"}
Expand Down Expand Up @@ -1040,9 +1052,35 @@ func setMavenConfig(config detectExecuteScanOptions) mavenBuildOptions {
Publish: false,
}

// Print the mavenBuildOptions configuration in verbose mode
log.Entry().Debugf("Maven configuration: %v", mavenConfig)

return mavenConfig
}

func setMTAConfig(config detectExecuteScanOptions) mtaBuildOptions {

if config.M2Path == "" {
config.M2Path = ".m2"
}

mtaConfig := mtaBuildOptions{
ProjectSettingsFile: config.ProjectSettingsFile,
GlobalSettingsFile: config.GlobalSettingsFile,
M2Path: config.M2Path,
Platform: config.MtaPlatform,
InstallArtifacts: true,
CreateBOM: false,
}

// Print the mtaBuildOptions configuration in verbose mode

log.Entry().Debugf("MTA configuration: %v", mtaConfig)

return mtaConfig

}

func logConfigInVerboseMode(config detectExecuteScanOptions) {
config.Token = "********"
config.GithubToken = "********"
Expand Down
22 changes: 22 additions & 0 deletions cmd/detectExecuteScan_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions resources/metadata/detectExecuteScan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ spec:
- STEPS
- STAGES
- PARAMETERS
- name: buildMTA
type: bool
default: false
description:
"Experiment parameter for MTA projects building"
scope:
- STEPS
- STAGES
- PARAMETERS
- name: generateReportsForEmptyProjects
type: bool
default: false
Expand All @@ -266,6 +275,14 @@ spec:
- STEPS
- STAGES
- PARAMETERS
- name: mtaPlatform
type: string
description: "The platform of the MTA project"
default: "CF"
scope:
- PARAMETERS
- STAGES
- STEPS
- name: pomPath
type: string
description: Path to the pom file which should be installed including all children.
Expand Down
Loading