+
This commit is contained in:
66
jenkins/流水线配置/s6.jennie.im_web.conf
Normal file
66
jenkins/流水线配置/s6.jennie.im_web.conf
Normal file
@@ -0,0 +1,66 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
gitParameter(
|
||||
branchFilter: 'origin/(.*)',
|
||||
defaultValue: 'dev',
|
||||
name: 'Code_branch',
|
||||
type: 'PT_BRANCH_TAG',
|
||||
selectedValue: 'DEFAULT',
|
||||
sortMode: 'NONE',
|
||||
description: '选择代码分支或标签: ',
|
||||
quickFilterEnabled: true,
|
||||
tagFilter: '*',
|
||||
listSize: "1"
|
||||
)
|
||||
}
|
||||
environment {
|
||||
WEB_HOST_IP = "43.130.56.138"
|
||||
WEB_HOST_PROJECT_PATH = "/data/tengine/html/s6-jennie-im-web/dist"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('拉取代码') {
|
||||
steps {
|
||||
git branch: "${params.Code_branch}", credentialsId: 'fly_gitlab_auth', url: 'http://172.24.16.20/web/jennie.git'
|
||||
}
|
||||
}
|
||||
|
||||
stage('pnpm i&b') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
export PATH="/data/node-v20.15.0/bin:$PATH"
|
||||
echo "开始安装依赖包"
|
||||
cd ${WORKSPACE}/ && rm -rf node_modules && pnpm install
|
||||
echo "开始构建"
|
||||
pnpm build:im
|
||||
mv dist/main/index.html dist/
|
||||
chmod -R 755 dist/
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('同步产物') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
cd ${WORKSPACE}/
|
||||
rsync -avzP --delete dist/ ${WEB_HOST_IP}:${WEB_HOST_PROJECT_PATH}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
echo "构建成功!"
|
||||
}
|
||||
failure {
|
||||
echo "构建失败!"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user