|
|
@@ -6,15 +6,23 @@ pipeline {
|
|
|
stages {
|
|
|
stage('Build') {
|
|
|
steps {
|
|
|
- sh 'npm install'
|
|
|
+ sh 'npm ci --prefer-offline'
|
|
|
sh 'npm run build'
|
|
|
}
|
|
|
}
|
|
|
stage('Deploy') {
|
|
|
steps {
|
|
|
- sh 'rsync -av --delete --exclude="web.config" --exclude="ecosystem.config.js" --exclude="restart.ps1" --exclude=".env*" .next/standalone/ ${DEPLOY_FRONTEND}/'
|
|
|
- sh 'rsync -av --delete .next/static/ ${DEPLOY_FRONTEND}/.next/static/'
|
|
|
- sh 'rsync -av --delete public/ ${DEPLOY_FRONTEND}/public/'
|
|
|
+ sh '''
|
|
|
+ rsync -a --stats --delete \
|
|
|
+ --exclude="web.config" \
|
|
|
+ --exclude="ecosystem.config.js" \
|
|
|
+ --exclude="restart.ps1" \
|
|
|
+ --exclude=".env*" \
|
|
|
+ --exclude="node_modules/.cache" \
|
|
|
+ .next/standalone/ ${DEPLOY_FRONTEND}/
|
|
|
+ '''
|
|
|
+ sh 'rsync -a --stats --delete .next/static/ ${DEPLOY_FRONTEND}/.next/static/'
|
|
|
+ sh 'rsync -a --stats --delete public/ ${DEPLOY_FRONTEND}/public/'
|
|
|
}
|
|
|
}
|
|
|
stage('Restart Frontend') {
|
|
|
@@ -28,4 +36,4 @@ pipeline {
|
|
|
success { echo 'Frontend deploy success!' }
|
|
|
failure { echo 'Frontend deploy failed!' }
|
|
|
}
|
|
|
-}
|
|
|
+}
|