website/Jenkinsfile
panjunjie 5a7a610104 add Jenkinsfile for Jenkins deploy
添加 Jenkins 部署文件

Signed-off-by: panjunjie <46790855@qq.com>
2025-08-10 20:36:01 +08:00

47 lines
993 B
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

pipeline {
agent any
tools {
nodejs 'NodeJS16'
}
stages {
stage('拉取代码') {
steps {
checkout scm
}
}
stage('安装依赖') {
steps {
sh 'npm install'
}
}
stage('构建项目') {
steps {
sh 'npm run build'
}
}
stage('部署项目') {
steps {
// 这里根据实际情况修改部署命令
sh '''
# 将dist目录拷贝到Nginx或其他Web服务器
rm -rf /data/nginx/www/fafamall/demo/*
cp -r dist/* /data/nginx/www/fafamall/demo//
'''
}
}
}
post {
success {
echo 'Vue项目部署成功'
}
failure {
echo 'Vue项目部署失败'
}
}
}