二级部署
parent
cb1fa73a4b
commit
91baf4185e
|
@ -3,4 +3,8 @@ ENV = 'production'
|
|||
|
||||
# 芋道管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
# 根据服务器或域名修改
|
||||
PUBLIC_PATH = 'http://you_ip.cn/yudao-admin/'
|
||||
# 二级部署路径
|
||||
VUE_APP_APP_NAME ='yudao-admin'
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ pipeline {
|
|||
|
||||
environment {
|
||||
APP_NAME = 'yudao-admin'
|
||||
APP_PACKAGE='yudao-admin-ui'
|
||||
PROJECT_DIR='yudao-admin-ui'
|
||||
NGINX_WORKDIR = '/home/pi/mydata/nginx/html/'
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ pipeline {
|
|||
|
||||
stage('构建') {
|
||||
steps {
|
||||
sh 'cnpm --prefix '+ "${env.APP_PACKAGE}" +' install'
|
||||
sh 'cnpm --prefix '+ "${env.APP_PACKAGE}" +' run build:prod'
|
||||
sh 'cnpm --prefix '+ "${env.PROJECT_DIR}" +' install'
|
||||
sh 'cnpm --prefix '+ "${env.PROJECT_DIR}" +' run build:prod'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,9 +34,9 @@ pipeline {
|
|||
steps {
|
||||
sh 'rm -f ' + "${env.APP_NAME}" + '/'+ "${env.APP_NAME}" + '.tar.gz'
|
||||
sh 'mkdir -p ' + "${env.NGINX_WORKDIR}" + "${env.APP_NAME}"
|
||||
sh 'cp -rf ' + "${env.APP_PACKAGE}" + '/dist/. ' + "${env.NGINX_WORKDIR}" + "${env.APP_NAME}"
|
||||
sh 'tar -zcvf ' + "${env.APP_PACKAGE}" + '/'+ "${env.APP_PACKAGE}" + '.tar.gz ' + "${env.APP_PACKAGE}" + '/dist/'
|
||||
archiveArtifacts "${env.APP_PACKAGE}" + '/'+ "${env.APP_PACKAGE}" + '.tar.gz'
|
||||
sh 'cp -rf ' + "${env.PROJECT_DIR}" + '/dist/. ' + "${env.NGINX_WORKDIR}" + "${env.APP_NAME}"
|
||||
sh 'tar -zcvf ' + "${env.PROJECT_DIR}" + '/'+ "${env.PROJECT_DIR}" + '.tar.gz ' + "${env.PROJECT_DIR}" + '/dist/'
|
||||
archiveArtifacts "${env.PROJECT_DIR}" + '/'+ "${env.PROJECT_DIR}" + '.tar.gz'
|
||||
//TODO 考虑刷新缓存的问题
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@ export const constantRoutes = [
|
|||
]
|
||||
|
||||
export default new Router({
|
||||
base: process.env.VUE_APP_APP_NAME ? process.env.VUE_APP_APP_NAME : "/",
|
||||
mode: 'history', // 去掉url中的#
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRoutes
|
||||
|
|
Loading…
Reference in New Issue