自动部署

prod
kanade 3 years ago
parent 92ec662c7f
commit 7f205259ca

@ -0,0 +1,74 @@
kind: pipeline
type: docker
name: master
steps:
- name: restore-cache
image: meltwater/drone-cache
settings:
backend: filesystem
restore: true
cache_key: node_modules-taskvue
archive_format: gzip
filesystem_cache_root: "/var/lib/cache"
mount:
- node_modules
volumes:
- name: cache
path: "/var/lib/cache"
# Do stuff..
- name: install
image: node:14
commands:
- yarn install
- name: rebuild-cache
image: meltwater/drone-cache
settings:
backend: filesystem
rebuild: true
cache_key: node_modules-taskvue
archive_format: gzip
filesystem_cache_root: "/var/lib/cache"
mount:
- 'node_modules'
volumes:
- name: cache
path: "/var/lib/cache"
# Do stuff..
- name: build
image: node:14
commands:
- yarn run build
- name: scp files
image: appleboy/drone-scp
settings:
host: 121.41.13.10
username:
from_secret: pro_user
password:
from_secret: pro_pass
port: 22
target: /data/data/wwwroot/sws.oa00.com
source: dist/*
- name: ssh
image: appleboy/drone-ssh
settings:
host: 121.41.13.10
username:
from_secret: pro_user
password:
from_secret: pro_pass
port: 22
script:
- cd /data/data/wwwroot/sws.oa00.com
- \cp -rf dist/* ./
- rm -rf dist
volumes:
- name: cache
host:
path: "/tmp/cache"
trigger:
branch:
- master
event:
- push
- merge

@ -1,5 +1,8 @@
# data-show
## build status
[![Build Status](https://drone.oa00.com/api/badges/SWS/carInsightSystem/status.svg?ref=refs/heads/master)](https://drone.oa00.com/SWS/carInsightSystem)
## Project setup
```
yarn install

@ -22,7 +22,7 @@ function filterRequestData(obj) {
}
//创建axios的实例
const httpService = axios.create({
baseURL: '/sws',// TODO:具体的配置可以根据项目情况而来
baseURL: 'http://cloud.sws010.com',// TODO:具体的配置可以根据项目情况而来
timeout: 5000
})
@ -32,7 +32,7 @@ httpService.interceptors.request.use(config => {
// if(localStorage.getItem('token')){//判断浏览器中的cookie中是否存在项目的token
// config.headers.token = localStorage.getItem('token')
// }
const rqData = filterRequestData(config.data);
const rqParams = filterRequestData(config.params);
// post 'Content-Type' === 'application/x-www-form-urlencoded'
@ -69,7 +69,7 @@ httpService.interceptors.response.use(response => {
// TODO:具体的code对应的处理可继续添加修改
if(err.response.Code === 301){
// console.log('登录过期');
//登录过期跳转登录页面并将要浏览的页面fullPath传过去登录成功后跳转需要访问的页面 ---主页(index) 或者 退出到登录前的浏览的页面
//登录过期跳转登录页面并将要浏览的页面fullPath传过去登录成功后跳转需要访问的页面 ---主页(index) 或者 退出到登录前的浏览的页面
//这样登录页面登录接口成功之后可以进行跳转 主页(index) 或者 退出到登录前的页面: let path = this.$route.query.redirect || '/index.js'; this.$router.push(path);
setTimeout(() => {
router.replace({

@ -11,19 +11,19 @@ const productionGzipExtensions = ['js', 'css', 'svg']
module.exports = {
productionSourceMap: false,
publicPath: "./",
devServer: {
port: "8081",
proxy: {
'/sws': {//代理api
target: "http://cloud.sws010.com",// 代理接口
changeOrigin: true,//是否跨域
ws: true, // proxy websockets
pathRewrite: {//重写路径
"^/sws": ''//代理路径
}
}
}
},
// devServer: {
// port: "8081",
// proxy: {
// '/sws': {//代理api
// target: "http://cloud.sws010.com",// 代理接口
// changeOrigin: true,//是否跨域
// ws: true, // proxy websockets
// pathRewrite: {//重写路径
// "^/sws": ''//代理路径
// }
// }
// }
// },
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
// 配置productionGzip-高级的方式

Loading…
Cancel
Save