postiz-app/Jenkinsfile
egelhaus 4f02747cbc
Some checks failed
Build Containers Enterprise / build-containers-common (push) Has been cancelled
Build Containers / build-containers-common (push) Has been cancelled
Build Containers Enterprise / build-containers (amd64, ubuntu-latest) (push) Has been cancelled
Build Containers Enterprise / build-containers (arm64, ubuntu-latest) (push) Has been cancelled
Build Containers Enterprise / build-container-manifest (push) Has been cancelled
Build Containers / build-containers (amd64, ubuntu-latest) (push) Has been cancelled
Build Containers / build-containers (arm64, ubuntu-latest) (push) Has been cancelled
Build Containers / build-container-manifest (push) Has been cancelled
Deactivate NodeJS Cache
2025-04-12 16:48:50 +02:00

93 lines
2.3 KiB
Groovy

pipeline {
agent any
environment {
NODE_VERSION = '20.17.0'
}
stages {
stage('Fetch Cache') {
options {
cache(caches: [
arbitraryFileCache(
cacheName: 'Next',
cacheValidityDecidingFile: '',
excludes: '',
includes: '**/*',
path: "./.nx/cache"
)
], defaultBranch: 'dev', maxCacheSize: 256000, skipSave: true)
}
steps {
echo 'Start fetching Cache.'
}
}
stage('Checkout Repository') {
steps {
checkout scm
}
}
stage('Check Node.js and npm') {
steps {
script {
sh "node -v"
sh "npm -v"
}
}
}
stage('Install Dependencies') {
steps {
sh 'npm ci'
}
}
stage('Run Unit Tests') {
steps {
sh 'npm test'
}
}
stage('Build Project') {
steps {
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"
)
], defaultBranch: 'dev', maxCacheSize: 256000, skipRestore: true)
}
steps {
echo 'Start saving Cache.'
}
}
}
post {
always {
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!'
}
failure {
echo 'Build failed!'
}
}
}