From d95c996f2be9c5c4c856205e91d6a5f547adc5a6 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 16 Apr 2024 11:13:34 +0200 Subject: [PATCH] fix(jenkins): Quote path-related variables in more places Guard against spaces in paths by quoting respective variables. Signed-off-by: Sebastian Schuberth --- integrations/jenkins/Jenkinsfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/integrations/jenkins/Jenkinsfile b/integrations/jenkins/Jenkinsfile index 4e38693d95894..8c613bbaa2656 100644 --- a/integrations/jenkins/Jenkinsfile +++ b/integrations/jenkins/Jenkinsfile @@ -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() } } @@ -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() } @@ -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 <"$ORT_CONFIG_DIR/config.yml" < $HOME/.netrc + echo "default login $LOGIN password $PASSWORD" > "$HOME/.netrc" rm -fr out/results/scanner /opt/ort/bin/ort $ORT_OPTIONS scan \ @@ -698,7 +698,7 @@ pipeline { $PROJECT_SCANNERS_OPTION \ $SCANNERS_OPTION - rm -f $HOME/.netrc + rm -f "$HOME/.netrc" fi '''.stripIndent().trim()