添加Jenkinsfile
parent
7b77cee483
commit
981c11c532
|
|
@ -4,12 +4,12 @@ NODE_ENV=production
|
|||
VITE_DEV=false
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://sasa.jh-web.cn'
|
||||
VITE_BASE_URL='http://specialty:48080'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload'
|
||||
VITE_UPLOAD_URL='http://specialty:48080/admin-api/infra/file/upload'
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
|
|
@ -24,7 +24,7 @@ VITE_DROP_CONSOLE=true
|
|||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/admin-ui-vue3/
|
||||
VITE_BASE_PATH=/
|
||||
|
||||
# 输出路径
|
||||
VITE_OUT_DIR=dist
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
NAME = "specialty-ui"
|
||||
VERSION = "0.0.1"
|
||||
ENVTYPE = "DEV"
|
||||
DEVIMGURL = "192.168.10.206:8888"
|
||||
DEVVERSION = "dev"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('拉取代码') {
|
||||
steps {
|
||||
echo "${ref}分支开始构建"
|
||||
checkout scmGit(branches: [[name: "${ref}"]], extensions: [], userRemoteConfigs: [[credentialsId: 'gitee', url: 'https://gitee.com/jianghewangluo/specialty.git']])
|
||||
}
|
||||
}
|
||||
|
||||
stage('编译代码') {
|
||||
steps {
|
||||
sh "npm config set registry https://registry.npmmirror.com"
|
||||
sh "npm install -g pnpm"
|
||||
sh "pnpm install"
|
||||
sh "pnpm install"
|
||||
}
|
||||
}
|
||||
|
||||
stage('打包') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'harbor', passwordVariable: 'password', usernameVariable: 'username')]) {
|
||||
sh "docker build -t ${DEVIMGURL}/library/${NAME}:${VERSION} ./"
|
||||
sh "echo ${password} | docker login -u ${username} --password-stdin http://${DEVIMGURL}"
|
||||
sh "docker push ${DEVIMGURL}/library/${NAME}:${VERSION}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('启动项目') {
|
||||
steps {
|
||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'saas', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'sh /home/start.sh', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue