Skip to content

Commit f7543be

Browse files
Implement MTA build for detectExecuteScan step (#4876)
* added-parameter * added-platform-param-for-mta-build * add-verbose-build-config-output * set-install-artifacts-true * comment-m2-defaults * returned-m2-param * synced-with-master * fix-yaml * fix-yaml2 * fix-yaml3 * fix-yaml3 * fix-yaml4 * returned-m2path-in-folder --------- Co-authored-by: Andrei Kireev <[email protected]>
1 parent 77758b3 commit f7543be

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

cmd/detectExecuteScan.go

+38
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,18 @@ func runDetect(ctx context.Context, config detectExecuteScanOptions, utils detec
213213
}
214214
}
215215

216+
// for MTA
217+
if config.BuildMTA {
218+
log.Entry().Infof("running MTA Build")
219+
mtaConfig := setMTAConfig(config)
220+
mtaUtils := newMtaBuildUtilsBundle()
221+
222+
err := runMtaBuild(mtaConfig, &mtaBuildCommonPipelineEnvironment{}, mtaUtils)
223+
if err != nil {
224+
return err
225+
}
226+
}
227+
216228
blackduckSystem := newBlackduckSystem(config)
217229

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

1055+
// Print the mavenBuildOptions configuration in verbose mode
1056+
log.Entry().Debugf("Maven configuration: %v", mavenConfig)
1057+
10431058
return mavenConfig
10441059
}
10451060

1061+
func setMTAConfig(config detectExecuteScanOptions) mtaBuildOptions {
1062+
1063+
if config.M2Path == "" {
1064+
config.M2Path = ".m2"
1065+
}
1066+
1067+
mtaConfig := mtaBuildOptions{
1068+
ProjectSettingsFile: config.ProjectSettingsFile,
1069+
GlobalSettingsFile: config.GlobalSettingsFile,
1070+
M2Path: config.M2Path,
1071+
Platform: config.MtaPlatform,
1072+
InstallArtifacts: true,
1073+
CreateBOM: false,
1074+
}
1075+
1076+
// Print the mtaBuildOptions configuration in verbose mode
1077+
1078+
log.Entry().Debugf("MTA configuration: %v", mtaConfig)
1079+
1080+
return mtaConfig
1081+
1082+
}
1083+
10461084
func logConfigInVerboseMode(config detectExecuteScanOptions) {
10471085
config.Token = "********"
10481086
config.GithubToken = "********"

cmd/detectExecuteScan_generated.go

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/metadata/detectExecuteScan.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ spec:
257257
- STEPS
258258
- STAGES
259259
- PARAMETERS
260+
- name: buildMTA
261+
type: bool
262+
default: false
263+
description:
264+
"Experiment parameter for MTA projects building"
265+
scope:
266+
- STEPS
267+
- STAGES
268+
- PARAMETERS
260269
- name: generateReportsForEmptyProjects
261270
type: bool
262271
default: false
@@ -266,6 +275,14 @@ spec:
266275
- STEPS
267276
- STAGES
268277
- PARAMETERS
278+
- name: mtaPlatform
279+
type: string
280+
description: "The platform of the MTA project"
281+
default: "CF"
282+
scope:
283+
- PARAMETERS
284+
- STAGES
285+
- STEPS
269286
- name: pomPath
270287
type: string
271288
description: Path to the pom file which should be installed including all children.

0 commit comments

Comments
 (0)