3.2.8 • Published 9 months ago

easier-deploy v3.2.8

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

easier-deploy 简易部署

通过指令实现自动化部署,压缩文件,上传文件到服务端,替换服务端文件,还能执行自定义脚本完成启动, 且支持分布式部署。

Usage 使用方法

安装依赖

npm i -D easier-deploy

在package.json中加入这个脚本

"script": {
    "deploy": "easier-deploy"
}

在终端输入这个指令

 npm run deploy [envkey] // eg: npm run deploy dev

如果你是第一次运行这个命令,它会在项目的根目录生成一个deploy.config.js文件。 然后你须修改这个文件去适配你的需求。

model.exports = {
	"context": './dist',
	"clean": false,
	"dev": [
		{
			"host": "10.0.0.1",
			"port": 22,
			"username": "admin",
			"password": "123456"
			"remotePath": "/home/admim/web/",
			"shell": "echo 'exec shell command success!!!'"
		}
	],
	[envKey]: []
}

你可以在终端上输入不同的环境键值去切换你的服务器配置,举个例子,你输入npm run dev 可以设置你的部署配置,然后就能把你的项目部署到dev服务器上。

deploy.config.js param 参数

namedescriptiontypedefault value
context项目的相对路径stringnull
clean清理服务器远端路径文件booleanfalse
envKey服务器配置Array[]

enKey param 环境参数

namedescriptiontypedefault value
host服务器ipstringnull
port服务起ssh端口numbernull
username服务器用户名stringnull
password服务器密码stringnull
privateKeyPath私钥地址,选填stringnull
privateKey私钥键码,选填stringnull
passphrase私钥密码,选填stringnull
remotePath目标远端地址stringnull
shell部署完成后可执行的脚本stringnull
3.2.8

9 months ago

3.2.7

9 months ago

3.2.6

9 months ago

3.2.5

9 months ago

3.2.4

9 months ago

3.2.2

9 months ago

3.2.1

9 months ago

3.2.0

9 months ago

3.1.0

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

3.0.0

10 months ago

2.0.0

10 months ago

1.0.0

10 months ago