@eyunmy/deploy
eyunmy deploy
Last updated 7 months ago by cirno9 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @eyunmy/deploy 
SYNC missed versions from official npm registry.

nodejs 部署项目

  1. 从 执行参数 读取 属性
  2. 从 配置文件 读取 属性
  3. 缺少的 属性 提示输入
  4. 压缩 编译目录 => tgz
  5. 连接到 服务器
  6. (如果备份目录不存在则创建 mkdir -p [backupPath])
  7. 上传 tgz 到 服务器 指定备份目录
  8. (如果部署目录不存在则创建 mkdir -p [deployPath])
  9. 在 服务器 解压tgz 到 指定部署目录

安装

npm install -g @eyunmy/deploy

用法

deploy --version
deploy --help
# 注: 需要在项目根目录, 编译目录按照当前目录查找, 压缩文件会创建在当前目录.
deploy

可传参数说明

<env> 用于 读取配置文件

  1. 配置文件 config(有该选项时, 则不会加载其他.env). 默认 .env .env.local .env.<env> .env.<env>.local
  2. 编译目录 buildPath. 默认 dist
  3. 服务器 用户名 serverUsername. 默认 admin
  4. 服务器 主机 serverHost
  5. 服务器(缩写 用户名@主机) serverUsername@serverHost
  6. 服务器 密码 password
  7. 备份目录 backupPath. 默认 ~
  8. 部署目录 deployPath. 默认 /var/www/html
  9. 部署命令 deployCommand. (不建议使用)
  10. 部署包文件名 packageName. (不建议使用)

参考配置文件

其中 serverUsername, serverHost 优先级比 server

BUILD_PATH='dist'
serverUsername='admin'
serverHost='SERVER_HOST'
SERVER='admin@SERVER_HOST'
PASSWORD='YOUR_SERVER_PASSWORD'
BACKUP_PATH='~'
DEPLOY_PATH='/var/www/html'

配置文件读取规则

例如 编译目录 buildPath 字段, 以下几种写法都ok, 优先级从上往下, 优先读上面的.

buildPath='dist'
BUILDPATH='dist'
buildpath='dist'
build_Path='dist'
BUILD_PATH='dist'
build_path='dist'

仓库

github eyunmy

Current Tags

  • 1.0.27                                ...           latest (7 months ago)

27 Versions

  • 1.0.27                                ...           7 months ago
  • 1.0.26                                ...           7 months ago
  • 1.0.25                                ...           7 months ago
  • 1.0.24                                ...           7 months ago
  • 1.0.23                                ...           7 months ago
  • 1.0.22                                ...           7 months ago
  • 1.0.21                                ...           7 months ago
  • 1.0.20                                ...           7 months ago
  • 1.0.19                                ...           7 months ago
  • 1.0.18                                ...           7 months ago
  • 1.0.17                                ...           7 months ago
  • 1.0.16                                ...           7 months ago
  • 1.0.15                                ...           7 months ago
  • 1.0.14                                ...           7 months ago
  • 1.0.13                                ...           7 months ago
  • 1.0.11                                ...           7 months ago
  • 1.0.10                                ...           7 months ago
  • 1.0.9                                ...           7 months ago
  • 1.0.8                                ...           7 months ago
  • 1.0.7                                ...           7 months ago
  • 1.0.6                                ...           7 months ago
  • 1.0.5                                ...           7 months ago
  • 1.0.4                                ...           7 months ago
  • 1.0.3                                ...           7 months ago
  • 1.0.2                                ...           7 months ago
  • 1.0.1                                ...           7 months ago
  • 1.0.0                                ...           7 months ago
Downloads
Today 0
This Week 0
This Month 27
Last Day 0
Last Week 27
Last Month 0
Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |