From c9f9255e5e382c2175a2aca1f5fcd1da84fe83cc Mon Sep 17 00:00:00 2001 From: xiaozhou233 Date: Sun, 9 Aug 2026 21:21:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20Jenkinsfile?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=B8=85=E7=90=86=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8C=BA=E5=92=8C=E6=89=93=E5=8C=85=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 3296b82..957e94e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,18 +8,27 @@ pipeline { 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' } @@ -28,11 +37,34 @@ pipeline { stage('Build') { steps { + // Build frontend dir('dashboard') { sh 'npm run build' } } } + stage('Package') { + steps { + // Package frontend + sh 'zip -r dashboard.zip dashboard/dist' + } + } + + } + + post { + success { + archiveArtifacts artifacts: 'dashboard.zip', fingerprint: true + echo 'Build succeeded' + } + + failure { + echo 'Build failed' + } + + always { + echo 'Pipeline finished' + } } } \ No newline at end of file