From 798e4af50fd90408db007a3516d64c450d12a402 Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Wed, 9 Apr 2025 17:19:25 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 71f2519c..6acff059 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,10 +65,7 @@ pipeline { junit '**/reports/junit.xml' archiveArtifacts artifacts: 'reports/**', fingerprint: true archiveArtifacts artifacts: 'build_report.log', fingerprint: true - cleanWs(cleanWhenNotBuilt: false, notFailBuild: true) - } - success { - echo 'Build completed successfully!' + // Cache after cleanup in 'always' cache(caches: [ arbitraryFileCache( cacheName: 'Next', @@ -85,6 +82,11 @@ pipeline { path: "~/.npm" // Use the HOME environment variable for home directory ) ], defaultBranch: 'dev', maxCacheSize: 256000, skipRestore: true) + + cleanWs(cleanWhenNotBuilt: false, notFailBuild: true) + } + success { + echo 'Build completed successfully!' } failure { echo 'Build failed!'