Skip to content

Commit 769067e

Browse files
authored
added-option-to-use-global-config-file (#5145)
1 parent b317b1d commit 769067e

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

cmd/whitesourceExecuteScan.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ func wsScanOptions(config *ScanOptions) *ws.ScanOptions {
490490
AgentDownloadURL: config.AgentDownloadURL,
491491
AgentFileName: config.AgentFileName,
492492
ConfigFilePath: config.ConfigFilePath,
493+
UseGlobalConfiguration: config.UseGlobalConfiguration,
493494
Includes: config.Includes,
494495
Excludes: config.Excludes,
495496
JreDownloadURL: config.JreDownloadURL,

cmd/whitesourceExecuteScan_generated.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/whitesource/scanOptions.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ type ScanOptions struct {
3131
DefaultNpmRegistry string
3232
NpmIncludeDevDependencies bool
3333

34-
AgentDownloadURL string
35-
AgentFileName string
36-
ConfigFilePath string
34+
AgentDownloadURL string
35+
AgentFileName string
36+
ConfigFilePath string
37+
UseGlobalConfiguration bool
3738

3839
JreDownloadURL string
3940

pkg/whitesource/scanUA.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ func (s *Scan) ExecuteUAScanInPath(config *ScanOptions, utils Utils, scanPath st
127127
}
128128
}
129129

130+
if config.UseGlobalConfiguration {
131+
config.ConfigFilePath, err = filepath.Abs(config.ConfigFilePath)
132+
if err != nil {
133+
return err
134+
}
135+
}
136+
130137
configPath, err := config.RewriteUAConfigurationFile(utils, s.AggregateProjectName, config.Verbose)
131138
if err != nil {
132139
return err

resources/metadata/whitesourceExecuteScan.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ spec:
128128
- STAGES
129129
- STEPS
130130
default: ./wss-unified-agent.config
131+
- name: useGlobalConfiguration
132+
type: bool
133+
description: "The parameter is applicable for multi-module mend projects. If set to true, the configuration file will be used for all modules. Otherwise each module will require its own configuration file in the module folder."
134+
scope:
135+
- PARAMETERS
136+
- GENERAL
137+
- STAGES
138+
- STEPS
139+
default: false
131140
- name: containerRegistryPassword
132141
description: "For `buildTool: docker`: Password for container registry access - typically provided by the CI/CD environment."
133142
type: string

0 commit comments

Comments
 (0)