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

feat(detectExecuteScan): Add useDetect9 for latest BlackDuck script #4649

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 12 additions & 1 deletion cmd/detectExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,17 @@ func getDetectScript(config detectExecuteScanOptions, utils detectUtils) error {

log.Entry().Infof("Downloading Detect Script")

if config.UseDetect9 {
err := utils.DownloadFile("https://detect.synopsys.com/detect9.sh", "detect.sh", nil, nil)
if err != nil {
time.Sleep(time.Second * 5)
err = utils.DownloadFile("https://detect.synopsys.com/detect9.sh", "detect.sh", nil, nil)
if err != nil {
return err
}
}
}

err := utils.DownloadFile("https://detect.synopsys.com/detect8.sh", "detect.sh", nil, nil)
if err != nil {
time.Sleep(time.Second * 5)
Expand Down Expand Up @@ -474,7 +485,7 @@ func addDetectArgs(args []string, config detectExecuteScanOptions, utils detectU
args = append(args, fmt.Sprintf("\"--detect.project.user.groups=%v\"", strings.Join(config.Groups, ",")))
}

// Atleast 1, non-empty category to fail on must be provided
// At least 1, non-empty category to fail on must be provided
if len(config.FailOn) > 0 && len(config.FailOn[0]) > 0 {
args = append(args, fmt.Sprintf("--detect.policy.check.fail.on.severities=%v", strings.Join(config.FailOn, ",")))
}
Expand Down
11 changes: 11 additions & 0 deletions cmd/detectExecuteScan_generated.go

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

11 changes: 11 additions & 0 deletions resources/metadata/detectExecuteScan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,17 @@ spec:
- STAGES
- STEPS
deprecated: true
- name: useDetect9
description:
"This flag allows to use version 9 of Detect Script"
aliases:
- name: detect/useDetect9
type: bool
scope:
- PARAMETERS
- STAGES
- STEPS
default: false
- name: successOnSkip
description:
"This flag allows forces Black Duck to exit with 0 error code if any step is skipped"
Expand Down
Loading