1.0.1 • Published 8 months ago

51cli v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

51cli脚手架

51cli脚手架是一个集开合和自动发布为一体的前端cli

1.使用须知

  • 1.保证你的服务器的ssh可被访问
  • 2.保证服务器安装了nodejs和nginx并已开启 systemctl start nginx
  • 3.保证防火墙已关闭systemctl stop firewalld.service
  • 4.已经修改过nginx的配置,具体配置放在末尾

2.使用

1.安装

npm i 51cli -g

2.使用

51cli create demo

3.功能

新建项目

新建项目 51cli create demo,支持选择3种不同的框架:

  • vue
  • react
  • angular

创建时可传递的参数:

  • -nf, --no-force 不强制覆盖当前目录下的一切内容
  • -ng, --no-git 不为当前项目初始化git仓库

部署项目

部署项目 51cli deploy,创建时可传递的参数:

  • -h, --host , 需要部署的服务器ip
  • -P, --port , 需要部署的服务器ssh登录端口
  • -u, --username , 需要部署的服务器登录密码
  • -p, --password , 需要部署的服务器登录密码

帮助

  • 51cli create -h
  • 51cli --help
  • 51cli create -nf --help
user root;
worker_processes  auto;
error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen 80;
        server_name localhost;

        location / {
                root /etc/nginx/dist;
                index index.html;
        }
    }
}