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

Jenkins pipeline fixes #8525

Merged
merged 2 commits into from
Apr 16, 2024
Merged
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
24 changes: 14 additions & 10 deletions integrations/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,12 @@ pipeline {
VCS_REVISION_OPTION="--vcs-revision $PROJECT_VCS_REVISION"
fi

echo "default login $LOGIN password $PASSWORD" > $HOME/.netrc
echo "default login $LOGIN password $PASSWORD" > "$HOME/.netrc"

rm -fr "$PROJECT_DIR"
/opt/ort/bin/ort $ORT_OPTIONS download --project-url $PROJECT_VCS_URL $VCS_REVISION_OPTION -o "$PROJECT_DIR/source"

rm -f $HOME/.netrc
rm -f "$HOME/.netrc"
'''.stripIndent().trim()
}
}
Expand Down Expand Up @@ -449,12 +449,12 @@ pipeline {
VCS_REVISION_OPTION="--vcs-revision $ORT_CONFIG_VCS_REVISION"
fi

echo "default login $LOGIN password $PASSWORD" > $HOME/.netrc
echo "default login $LOGIN password $PASSWORD" > "$HOME/.netrc"

rm -fr $ORT_DATA_DIR/config
/opt/ort/bin/ort $ORT_OPTIONS download --project-url $ORT_CONFIG_VCS_URL $VCS_REVISION_OPTION -o $ORT_DATA_DIR/config
rm -fr "$ORT_DATA_DIR/config"
/opt/ort/bin/ort $ORT_OPTIONS download --project-url $ORT_CONFIG_VCS_URL $VCS_REVISION_OPTION -o "$ORT_DATA_DIR/config"

rm -f $HOME/.netrc
rm -f "$HOME/.netrc"
'''.stripIndent().trim()
}

Expand All @@ -467,7 +467,7 @@ pipeline {
echo "Not creating '$ORT_CONFIG_DIR/config.yml' as it already exists."
else
echo "Creating '$ORT_CONFIG_DIR/config.yml' template for job parameters."
cat >$ORT_CONFIG_DIR/config.yml <<EOF
cat >"$ORT_CONFIG_DIR/config.yml" <<EOF
ort:
packageCurationProviders:
- name: DefaultFile
Expand Down 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 @@ -688,16 +688,17 @@ pipeline {
PACKAGE_TYPES_OPTION=${PACKAGE_TYPES_OPTION// /,}
PACKAGE_TYPES_OPTION="--package-types $PACKAGE_TYPES_OPTION"

echo "default login $LOGIN password $PASSWORD" > $HOME/.netrc
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 \
$PACKAGE_TYPES_OPTION \
$PROJECT_SCANNERS_OPTION \
$SCANNERS_OPTION

rm -f $HOME/.netrc
rm -f "$HOME/.netrc"
fi
'''.stripIndent().trim()

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
Loading