From 632639bb409ca80d1a8b072b7c3eb72a27a02e60 Mon Sep 17 00:00:00 2001 From: egelhaus <156946629+egelhaus@users.noreply.github.com> Date: Wed, 9 Apr 2025 21:26:34 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 61 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 85101ae9..f97e5c9f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,23 +6,27 @@ pipeline { } stages { - options { - cache(caches: [ - arbitraryFileCache( - cacheName: 'Next', - cacheValidityDecidingFile: '', - excludes: '', - includes: '**/*', - path: "./.nx/cache" - ), - arbitraryFileCache( - cacheName: 'NodeJS', // Added a cache name for better clarity - cacheValidityDecidingFile: '', - excludes: '', - includes: '**/*', - path: "./node_modules" // Use the HOME environment variable for home directory - ) - ], defaultBranch: 'dev', maxCacheSize: 256000) + stage('Fetch Cache') { + options { + cache(caches: [ + arbitraryFileCache( + cacheName: 'Next', + cacheValidityDecidingFile: '', + excludes: '', + includes: '**/*', + path: "./.nx/cache" + ), + arbitraryFileCache( + cacheName: 'NodeJS', // Added a cache name for better clarity + cacheValidityDecidingFile: '', + excludes: '', + includes: '**/*', + path: "./node_modules" // Use the HOME environment variable for home directory + ) + ], defaultBranch: 'dev', maxCacheSize: 256000, skipSave: true) + } + steps { + } } stage('Checkout Repository') { @@ -57,6 +61,29 @@ pipeline { sh 'npm run build 2>&1 | tee build_report.log' // Captures build output } } + + stage('Save Cache') { + options { + cache(caches: [ + arbitraryFileCache( + cacheName: 'Next', + cacheValidityDecidingFile: '', + excludes: '', + includes: '**/*', + path: "./.nx/cache" + ), + arbitraryFileCache( + cacheName: 'NodeJS', // Added a cache name for better clarity + cacheValidityDecidingFile: '', + excludes: '', + includes: '**/*', + path: "./node_modules" // Use the HOME environment variable for home directory + ) + ], defaultBranch: 'dev', maxCacheSize: 256000, skipRestore: true) + } + steps { + } + } } post {