Jet-Deploy
对于前后端分离的项目,使用 Vue、React、Angular 构建完成的单页面应用,或是包含 html 页面的静态资源,亦或任意格式的文件资源,Jet-Deploy 可以帮助你将要发布的文件快速上传到远程服务器的指定目录,高效协助项目应用的测试、或部署。
全局安装
yarn global add jet-deploy #或者 npm install jet-deploy -g
全局使用
➜ react-demo ➜ jet-deploy --helpUsage: index [options] Options: -V, --version output the version number -h --host [ip] 服务器地址 -p --port [number] 服务器端口 -u --user [string] 服务器用户名 -P --password [string] 服务器密码 -r --remotePath [string] 服务器目标路径 -i --includeHtml [string] 是否包含 html 文件 -h, --help output usage information
基本功能
# 将当前目录下的所有文件上传到远程服务器 jet-deploy # 将当前目录下的 dist 目录中的所有文件上传到远程服务器 jet-deploy dist # 将 /User/furic/wwww/project-demo/dist 目录下所有文件上传到远程服务器 jet-deploy /User/furic/wwww/project-demo/dist # 将当前目录下的 dist 目录中的所有文件上传到远程服务器的 /root/www 目录下 jet-deploy dist -r /root/www #或者 jet-deploy dist -remotePath /root/www # 将当前目录下的 dist 目录中的所有静态文件(不包括html)上传到远程服务器 jet-deploy dist -i false # 或者 jet-deploy dist --includeHtml false # 配置默认的服务器参数 jet-deploy dist --host 10.211.55.3 --port 22 --user root --password 123456 --remotePath /root/www
使用示例
➜ react-demo ➜ jet-deploy dist+--------------------------------------------+| || 欢迎使用jet-deploy应用文件远端部署工具 || |+--------------------------------------------+? 请填写服务器IP地址: 10.211.55.3? 请填写服务器端口号: 22? 请填写服务器用户名: root? 请填写服务器密码: [hidden]? 请填写服务器目标路径: /root/www成功上传:asset-manifest.json成功上传:favicon.ico成功上传:index.html成功上传:manifest.json成功上传:precache-manifest.4181eb8e15bbf21d18c638b21a1f5735.js成功上传:service-worker.js成功上传:lib/es6-promise.min.js成功上传:lib/fastclick.js成功上传:static/css/2.f7b7b57a.chunk.css成功上传:static/css/index.a0329fdf.chunk.css成功上传:static/js/2.f3063d09.chunk.js成功上传:static/js/2.f3063d09.chunk.js.LICENSE.txt成功上传:static/js/2.f3063d09.chunk.js.map成功上传:static/js/index.d2342c63.chunk.js成功上传:static/js/runtime-index.dd1f1907.jsdeploy succeed.
项目中本地安装
yarn add jet-deploy -D #或者 npm install jet-deploy --save-dev
项目中本地使用
在项目的package.json
文件中配置scripts
。
执行:
yarn deploy #或者 npm run deploy
如果不便于公开服务器密码,
--password
参数可以省略,将在命令行中动态输入服务器密码。
License
Copyright (c) 2020-present, chanjet-fe.