Skip to content

Commit

Permalink
fix(jenkins): Consistenly delete output directories before running tools
Browse files Browse the repository at this point in the history
Delete the directories that get archived by Jenkins after the step has
run to avoid any left-over artifacts to get archived for the wrong run
(as has happened with the reporter).

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Apr 16, 2024
1 parent bdecdaa commit 70e15d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion integrations/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ pipeline {
/opt/ort/bin/set_gradle_proxy.sh
rm -fr out/results
rm -fr out/results/analyzer
/opt/ort/bin/ort $ORT_OPTIONS analyze -i "$PROJECT_DIR/source/$ANALYZER_INPUT_PATH" -o out/results/analyzer -l JENKINS_BUILD_URL=$BUILD_URL
'''.stripIndent().trim()

Expand Down Expand Up @@ -690,6 +690,7 @@ pipeline {
echo "default login $LOGIN password $PASSWORD" > $HOME/.netrc
rm -fr out/results/scanner
/opt/ort/bin/ort $ORT_OPTIONS scan \
-i out/results/current-result.yml \
-o out/results/scanner \
Expand Down Expand Up @@ -778,6 +779,7 @@ pipeline {
ADVISOR_OPTIONS="-a OSV,VulnerableCode"
rm -fr out/results/advisor
/opt/ort/bin/ort $ORT_OPTIONS advise $ADVISOR_OPTIONS -i out/results/current-result.yml -o out/results/advisor
'''.stripIndent().trim()

Expand Down Expand Up @@ -848,6 +850,7 @@ pipeline {
RULES_OPTIONS="$RULES_OPTIONS --rules-file $ORT_CONFIG_DIR/evaluator.rules.kts"
fi
rm -fr out/results/evaluator
/opt/ort/bin/ort $ORT_OPTIONS evaluate -i out/results/current-result.yml $RULES_OPTIONS -o out/results/evaluator
'''.stripIndent().trim()

Expand Down Expand Up @@ -914,6 +917,7 @@ pipeline {
REPORT_FORMATS_OPTIONS_OPTION="-O $REPORT_FORMATS_OPTIONS"
fi
rm -fr out/results/reporter
/opt/ort/bin/ort $ORT_OPTIONS report \
-i out/results/current-result.yml \
-o out/results/reporter \
Expand Down

0 comments on commit 70e15d1

Please sign in to comment.