- 前端自动化构建部署从0-1的过程(Nginx)
- 熟悉Drone的基本原理
- 使用Drone构建部署前端应用
- 使用Drone CLI Promote指定环境
- 基于Drone API的运维系统开发能力
方向代理服务 nginx
安装nginx yum install nginx -y
启动nginx systemctl start nginx
vim /etc/nginx/nginx.conf
user nginx; 改为user root;include /etc/nginx/default.d/*.conf 引入此目录下全部的配置文件
touch doc.conf
或者 vim /etc/nginx/cong.d/doc.conf
server {listen 80;server_name xx;location / {root /root/doc;index index.html;}}
检查nginx语法 nginx -t
重启 nginx -s reload
访问检查
shell 实现 npm install npm run build
构建部署工具库:
- rsync。
Rsyncis a class for building and executingrsynccommands with Node.js.增量同步 - shelljs。ShellJS is a portable (Windows/Linux/OS X) implementation of Unix shell commands on top of the Node.js API.
- yargs。Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.
- colors/chalk
- // 安装依赖
- // 测试
- // 构建
- // 部署
- // 通知,开始部署 ```
```
git repo: https://github.com/gongchao/doc-example
