Skip to content

Commit

Permalink
feat(jenkins): Expose the report formats and their options as parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Apr 15, 2024
1 parent 8c9dc82 commit eac85ce
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions integrations/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ pipeline {
description: 'Run the reporter tool.',
defaultValue: true
)

string(
name: 'REPORT_FORMATS',
description: 'A comma-separated list of report formats to generate.',
defaultValue: 'CycloneDX,SpdxDocument,PdfTemplate,PlainTextTemplate,StaticHTML,WebApp'
)

string(
name: 'REPORT_FORMATS_OPTIONS',
description: 'A comma-separated list of report-format-specific options, e.g. "PlainTextTemplate=template.id=NOTICE_SUMMARY".',
defaultValue: ''
)
}

stages {
Expand Down Expand Up @@ -894,10 +906,19 @@ pipeline {
ORT_OPTIONS="$ORT_OPTIONS --stacktrace"
fi
if [ -n "$REPORT_FORMATS" ]; then
REPORT_FORMATS_OPTION="-f $REPORT_FORMATS"
fi
if [ -n "$REPORT_FORMATS_OPTIONS" ]; then
REPORT_FORMATS_OPTIONS_OPTION="-O $REPORT_FORMATS_OPTIONS"
fi
/opt/ort/bin/ort $ORT_OPTIONS report \
-f CycloneDX,SpdxDocument,PdfTemplate,PlainTextTemplate,StaticHTML,WebApp \
-i out/results/current-result.yml \
-o out/results/reporter
-o out/results/reporter \
$REPORT_FORMATS_OPTION \
$REPORT_FORMATS_OPTIONS_OPTION
'''.stripIndent().trim()
}

Expand Down

0 comments on commit eac85ce

Please sign in to comment.