初始化提交
This commit is contained in:
53
jenkins/流水线配置/sit_lessie_official_web.conf
Normal file
53
jenkins/流水线配置/sit_lessie_official_web.conf
Normal file
@@ -0,0 +1,53 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
CODE_BRANCH = "dev"
|
||||
LOCKHOST_IP = "192.168.70.15"
|
||||
LOCKHOST_PROJECT_PATH = "/data/webapps/lessie-oficial" // 本地机器项目路径
|
||||
|
||||
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('拉取代码') {
|
||||
steps {
|
||||
git branch: "${CODE_BRANCH}",
|
||||
credentialsId: 'fly_gitlab_auth',
|
||||
url: 'http://172.24.16.20/web/scalelink-frontend.git'
|
||||
}
|
||||
}
|
||||
stage('同步到本地机器') {
|
||||
steps {
|
||||
sh """
|
||||
rsync -avz ${WORKSPACE}/ ${LOCKHOST_IP}:${LOCKHOST_PROJECT_PATH}/
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('依赖和构建') {
|
||||
steps {
|
||||
sh """
|
||||
ssh ${LOCKHOST_IP} 'bash -lc "
|
||||
cd ${LOCKHOST_PROJECT_PATH}/projects/lessie &&
|
||||
bash &&
|
||||
pnpm install &&
|
||||
pnpm build
|
||||
"'
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('启动') {
|
||||
steps {
|
||||
sh """
|
||||
ssh ${LOCKHOST_IP} 'bash -lc "
|
||||
cd ${LOCKHOST_PROJECT_PATH}/projects/lessie &&
|
||||
bash &&
|
||||
pm2 list && pm2 delete lessie-official-web &&
|
||||
pm2 start .output/server/index.mjs --name lessie-official-web --output ./nuxt-out.log --error ./nuxt-error.log &&
|
||||
pm2 list
|
||||
"'
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user