Skip to content

Commit

Permalink
fix(jenkins): Quote path-related variables in more places
Browse files Browse the repository at this point in the history
Guard against spaces in paths by quoting respective variables.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Apr 16, 2024
1 parent 6ab627f commit a6a852f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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 @@ -688,7 +688,7 @@ 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 \
Expand All @@ -698,7 +698,7 @@ pipeline {
$PROJECT_SCANNERS_OPTION \
$SCANNERS_OPTION
rm -f $HOME/.netrc
rm -f "$HOME/.netrc"
fi
'''.stripIndent().trim()

Expand Down

0 comments on commit a6a852f

Please sign in to comment.