From 0ea45ce986aa148251c4bfedeb2efcf21d146732 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 28 Nov 2020 00:37:05 +0100 Subject: [PATCH] Jenkins: Cache allure history between job runs --- Jenkinsfile | 8 +++++++- tests/modules/Jenkinsfile | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2aa2ccf16..6882a9916 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -125,7 +125,13 @@ def processAllure() { node { deleteDir() unstash 'allure' - sh 'docker run --rm -v $PWD:/work -u $(id -u) tobix/allure-cli generate allure-*' + sh 'mv allure-* allure-data' + copyArtifacts filter: 'allure-history.zip', optional: true, projectName: JOB_NAME + if (fileExists('allure-history.zip')) { + unzip dir: 'allure-data', quiet: true, zipFile: 'allure-history.zip' + sh 'rm -f allure-history.zip' + } + sh 'docker run --rm -v $PWD:/work -u $(id -u) tobix/allure-cli generate allure-data' zip archive: true, dir: 'allure-report', glob: 'history/**', zipFile: 'allure-history.zip' publishHTML reportDir: 'allure-report', reportFiles: 'index.html', reportName: 'Allure Report' } diff --git a/tests/modules/Jenkinsfile b/tests/modules/Jenkinsfile index b12f3bd29..a8cc0c3c2 100644 --- a/tests/modules/Jenkinsfile +++ b/tests/modules/Jenkinsfile @@ -53,8 +53,13 @@ ansiColor('xterm') { } stage('Allure Report') { + copyArtifacts filter: 'allure-history.zip', optional: true, projectName: JOB_NAME + if (fileExists('allure-history.zip')) { + unzip dir: 'allure-data', quiet: true, zipFile: 'allure-history.zip' + sh 'rm -f allure-history.zip' + } sh 'docker run --rm -v $PWD:/work -u $(id -u) tobix/allure-cli generate allure-data' - zip archive: true, dir: 'allure-report', glob: 'history/**', overwrite: true, zipFile: 'allure-history.zip' + zip archive: true, dir: 'allure-report', glob: 'history/**', zipFile: 'allure-history.zip' publishHTML reportDir: 'allure-report', reportFiles: 'index.html', reportName: 'Allure Report' } }