diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 014704f6db5..f0c6335591a 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -394,21 +394,21 @@ def junitAndStore(Map args = [:]) { /** * This method populates the test output using the runbld approach. For such it requires the -* global variable stashedTestReports. +* global variable stashedTestReports. +* TODO: should be moved to the shared library */ def runbld() { catchError(buildResult: 'SUCCESS', message: 'runbld post build action failed.') { if (stashedTestReports) { - def jobName = 'elastic+beats' - if (isPR()) { - jobName = 'elastic+beats+pull-request' - } + def jobName = isPR() ? 'elastic+beats+pull-request' : 'elastic+beats' deleteDir() unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}") - // Unstash the test reports - stashedTestReports.each { k, v -> - dir(k) { - unstash(v) + dir("${env.BASE_DIR}") { + // Unstash the test reports + stashedTestReports.each { k, v -> + dir(k) { + unstash(v) + } } } sh(label: 'Process JUnit reports with runbld',