Update Jenkinsfile

This commit is contained in:
egelhaus 2025-04-09 21:26:34 +02:00 committed by GitHub
parent 3c00ea792a
commit 632639bb40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 44 additions and 17 deletions

61
Jenkinsfile vendored
View File

@ -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 {