Files
JuiceWorkStation/Jenkinsfile
T

70 lines
1.3 KiB
Groovy

pipeline {
agent any
tools {
nodejs 'nodejs'
}
options {
timestamps()
disableConcurrentBuilds()
buildDiscarder(
logRotator(
numToKeepStr: '10',
artifactNumToKeepStr: '5'
)
)
}
stages {
stage('Checkout') {
steps {
cleanWs()
checkout scm
}
}
stage('Install') {
steps {
// Install frontend dependencies
dir('dashboard') {
sh 'npm ci'
}
}
}
stage('Build') {
steps {
// Build frontend
dir('dashboard') {
sh 'npm run build'
}
}
}
stage('Package') {
steps {
// Package frontend
sh 'zip -r dashboard.zip -j dashboard/dist/*'
}
}
}
post {
success {
archiveArtifacts artifacts: 'dashboard.zip', fingerprint: true
echo 'Build succeeded'
}
failure {
echo 'Build failed'
}
always {
echo 'Pipeline finished'
}
}
}