Skip to content

Commit

Permalink
added detect9 (#4920)
Browse files Browse the repository at this point in the history
  • Loading branch information
akram8008 authored May 3, 2024
1 parent 0aac696 commit fb809a2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cmd/detectExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,16 @@ func getDetectScript(config detectExecuteScanOptions, utils detectUtils) error {

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

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

if err := downloadScript(); err != nil {
time.Sleep(5 * time.Second)
return downloadScript()
}

return nil
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 @@ -601,6 +601,17 @@ spec:
resourceRef:
- name: commonPipelineEnvironment
param: container/repositoryPassword
- name: useDetect9
description:
"This flag enables the use of the supported version 9 of the Detect Script instead of v8"
aliases:
- name: detect/useDetect9
type: bool
scope:
- PARAMETERS
- STAGES
- STEPS
default: false
outputs:
resources:
- name: influx
Expand Down

0 comments on commit fb809a2

Please sign in to comment.