node-ssh-deploy
v0.0.4
Published
基于[SSH-Deployer](https://github.com/barend-erasmus/ssh-deployer/tree/master) 修改的一键部署工具。
Readme
Node SSH Deployer
基于SSH-Deployer 修改的一键部署工具。
Usage: ssh-deployer [options]
Options:
-f, --file JSON Configuration File [required]Getting Started
安装
npm install node-ssh-deploy配置文件
在项目根目录下创建一个配置文件,例如 'deploy.json',内容如下:
{
"outputDir": "dist",
"dest": {
"host": "123.45.67.89",
"port": "22",
"username": "username",
"password": "password",
"path": "/path/to/your/project",
"privateKey": "path/to/privateKey"
}
}outputDir:本地项目打包后的目录,默认为dist。dest:远程服务器的配置信息。host:远程服务器地址。port:远程服务器端口,默认为22。username:远程服务器用户名。password:远程服务器密码。path:远程服务器部署路径。privateKey:远程服务器私钥路径。
运行
ssh-deployer --file "deploy.json"或在项目 package.json 中添加脚本:
"scripts": {
"deploy": "ssh-deployer -f deploy.json"
}然后运行 npm run deploy
