Skip to content

Commit

Permalink
added-option-to-use-global-config-file (#5145)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaste authored Oct 18, 2024
1 parent b317b1d commit 769067e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/whitesourceExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ func wsScanOptions(config *ScanOptions) *ws.ScanOptions {
AgentDownloadURL: config.AgentDownloadURL,
AgentFileName: config.AgentFileName,
ConfigFilePath: config.ConfigFilePath,
UseGlobalConfiguration: config.UseGlobalConfiguration,
Includes: config.Includes,
Excludes: config.Excludes,
JreDownloadURL: config.JreDownloadURL,
Expand Down
11 changes: 11 additions & 0 deletions cmd/whitesourceExecuteScan_generated.go

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

7 changes: 4 additions & 3 deletions pkg/whitesource/scanOptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ type ScanOptions struct {
DefaultNpmRegistry string
NpmIncludeDevDependencies bool

AgentDownloadURL string
AgentFileName string
ConfigFilePath string
AgentDownloadURL string
AgentFileName string
ConfigFilePath string
UseGlobalConfiguration bool

JreDownloadURL string

Expand Down
7 changes: 7 additions & 0 deletions pkg/whitesource/scanUA.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ func (s *Scan) ExecuteUAScanInPath(config *ScanOptions, utils Utils, scanPath st
}
}

if config.UseGlobalConfiguration {
config.ConfigFilePath, err = filepath.Abs(config.ConfigFilePath)
if err != nil {
return err
}
}

configPath, err := config.RewriteUAConfigurationFile(utils, s.AggregateProjectName, config.Verbose)
if err != nil {
return err
Expand Down
9 changes: 9 additions & 0 deletions resources/metadata/whitesourceExecuteScan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ spec:
- STAGES
- STEPS
default: ./wss-unified-agent.config
- name: useGlobalConfiguration
type: bool
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."
scope:
- PARAMETERS
- GENERAL
- STAGES
- STEPS
default: false
- name: containerRegistryPassword
description: "For `buildTool: docker`: Password for container registry access - typically provided by the CI/CD environment."
type: string
Expand Down

0 comments on commit 769067e

Please sign in to comment.