自动部署

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
})

@ -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