Welcome to web-pub 👋
一款用于发布静态资源到服务器的脚本。
🏠 Homepage
Prerequisites
-
node >= 18.0.0
-
npm >= 9.8.1
-
yarn >= 1.22.0
Author
👤 Smilydes
-
Github: @github+DESsmily
起步
-
npm install web-pub -g
ssh操作
-
查看ssh配置
web-pub ssh list
-
添加ssh配置
web-pub ssh add <名称> <host@port> <user> <password>
– web-pub ssh add test 127.0.0.1@22 root 123456
- 删除指定ssh配置
web-pub ssh del test
– web-pub ssh del <name>
部署
– web-pub use <ssh名称> <远程服务器部署路径>
示例
# 进入web/dist打包好的目录将dist目录内的文件上传到指定服务器的 /mnt/statics/test目录中
cd /web/dist
web-pub use test /mnt/statics/test
配合项目使用
// package.json
{
...
"script"{
...
"publish": yarn build && cd dist && web-pub use test /mnt/statics/test-dev
}
...
}
Give a ⭐️ if this project helped you!
这款小工具可以自己用来玩玩,上传资源到自己的服务器啥的,目前大部分项目都是用的流水线自动部署方案
原文链接:https://juejin.cn/post/7357674793791651880 作者:摸鱼了