From cf64a0d0988477b2f1b1fe90ef54924847d01862 Mon Sep 17 00:00:00 2001 From: Sven Merk <33895725+nevskrem@users.noreply.github.com> Date: Wed, 16 Oct 2019 13:49:47 +0200 Subject: [PATCH 1/3] whitesourceExecuteScan: Transfer logs into workspace to allow archiving --- vars/whitesourceExecuteScan.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vars/whitesourceExecuteScan.groovy b/vars/whitesourceExecuteScan.groovy index 187deaf96..a3dbda222 100644 --- a/vars/whitesourceExecuteScan.groovy +++ b/vars/whitesourceExecuteScan.groovy @@ -409,7 +409,8 @@ private def triggerWhitesourceScanWithUserKey(script, config, utils, descriptorU archiveArtifacts artifacts: "**/ws-l*", allowEmptyArchive: true // archive UA log file - archiveArtifacts artifacts: "/var/log/UA/**/*.log", allowEmptyArchive: true + sh 'cp -Rf --parents /var/log/UA/* .' + archiveArtifacts artifacts: "var/log/UA/**/*.log", allowEmptyArchive: true } break } From 3d1da388c8d693612f887b3490765c31821ce8d9 Mon Sep 17 00:00:00 2001 From: Sven Merk <33895725+nevskrem@users.noreply.github.com> Date: Wed, 16 Oct 2019 14:58:54 +0200 Subject: [PATCH 2/3] Update whitesourceExecuteScan.groovy --- vars/whitesourceExecuteScan.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/whitesourceExecuteScan.groovy b/vars/whitesourceExecuteScan.groovy index a3dbda222..dacfde861 100644 --- a/vars/whitesourceExecuteScan.groovy +++ b/vars/whitesourceExecuteScan.groovy @@ -409,8 +409,8 @@ private def triggerWhitesourceScanWithUserKey(script, config, utils, descriptorU archiveArtifacts artifacts: "**/ws-l*", allowEmptyArchive: true // archive UA log file - sh 'cp -Rf --parents /var/log/UA/* .' - archiveArtifacts artifacts: "var/log/UA/**/*.log", allowEmptyArchive: true + sh "cp -Rf --parents /var/log/UA/* ." + archiveArtifacts artifacts: "**/var/log/UA/**/*.log", allowEmptyArchive: true } break } From 5bf5a6013ca304eb8d9fbf57542fb056e9ea922d Mon Sep 17 00:00:00 2001 From: Sven Merk <33895725+nevskrem@users.noreply.github.com> Date: Thu, 17 Oct 2019 15:24:09 +0200 Subject: [PATCH 3/3] Update whitesourceExecuteScan.groovy --- vars/whitesourceExecuteScan.groovy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vars/whitesourceExecuteScan.groovy b/vars/whitesourceExecuteScan.groovy index dacfde861..96027dcc7 100644 --- a/vars/whitesourceExecuteScan.groovy +++ b/vars/whitesourceExecuteScan.groovy @@ -408,9 +408,13 @@ private def triggerWhitesourceScanWithUserKey(script, config, utils, descriptorU // archive whitesource debug files, if available archiveArtifacts artifacts: "**/ws-l*", allowEmptyArchive: true - // archive UA log file - sh "cp -Rf --parents /var/log/UA/* ." - archiveArtifacts artifacts: "**/var/log/UA/**/*.log", allowEmptyArchive: true + try { + // archive UA log file + sh "cp -Rf --parents /var/log/UA/* ." + archiveArtifacts artifacts: "**/var/log/UA/**/*.log", allowEmptyArchive: true + } catch (e) { + echo "Failed archiving WhiteSource UA logs" + } } break }