Skip to content

Commit 44b2e8a

Browse files
committed
Jenkinsfile: Support ClearlyDefined as a scan storage
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
1 parent dace5da commit 44b2e8a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

integrations/jenkins/Jenkinsfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ pipeline {
143143
choices: ['ScanCode', 'Askalono', 'BoyterLc', 'Licensee', 'ScanOSS', '<NONE>']
144144
)
145145

146+
booleanParam(
147+
name: 'USE_CLEARLY_DEFINED_SCAN_STORAGE',
148+
description: 'Use the ClearlyDefined service to retrieve existing scan results. This overrides any other scan storage configuration.',
149+
defaultValue: true
150+
)
151+
146152
/*
147153
* ORT advisor tool parameters.
148154
*/
@@ -409,6 +415,18 @@ pipeline {
409415
410416
ORT_OPTIONS="$LOG_LEVEL -P ort.scanner.skipConcluded=$SKIP_CONCLUDED"
411417
418+
if [ "$USE_CLEARLY_DEFINED_SCAN_STORAGE" = "true" ]; then
419+
# Configure the default local file storage explicitly to be able to refer to it.
420+
ORT_OPTIONS="$ORT_OPTIONS -P ort.scanner.storages.localFiles.backend.localFileStorage.directory=$HOME/.ort/scanner/results"
421+
422+
# Configure the ClearlyDefined remote storage.
423+
ORT_OPTIONS="$ORT_OPTIONS -P ort.scanner.storages.clearlyDefined.serverUrl=https://api.clearlydefined.io"
424+
425+
# Take both storages into use.
426+
ORT_OPTIONS="$ORT_OPTIONS -P ort.scanner.storageReaders=localFiles,clearlyDefined \
427+
-P ort.scanner.storageWriters=localFiles"
428+
fi
429+
412430
if [ "$STACKTRACE" = "true" ]; then
413431
ORT_OPTIONS="$ORT_OPTIONS --stacktrace"
414432
fi

0 commit comments

Comments
 (0)