简化更新

This commit is contained in:
2024-11-07 01:49:53 +08:00
parent 7da1c994e9
commit cd1db1b82a
3 changed files with 6 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
export host=main
export HOST=ai
# 运行本地开发环境(使用SSH隧道代理端口)
dev:
@@ -6,7 +6,7 @@ dev:
echo "github.com/air-verse/air@latest is not installed. Installing..."; \
go get github.com/air-verse/air@latest; \
fi;
@ssh -NCPf main -L 3306:localhost:3306 -L 19530:localhost:19530 & \
@ssh -NCPf ${HOST} -L 3306:localhost:3306 -L 19530:localhost:19530 & \
sleep 1; \
go run github.com/air-verse/air@latest --build.cmd "go build -o ./data/ bin/main.go" --build.bin "./data/main"; \
wait
@@ -21,11 +21,8 @@ build:
# 更新部署到服务器
update: build
ssh $(host) "mv ~/webp/main ~/webp/main_old"
scp dist/main $(host):~/webp/main
scp dist/main $(HOST):~/webp/main
rm -rf dist
ssh $(host) "systemctl restart webp"
ssh $(host) "rm ~/webp/main_old"
# 设为系统服务和设置日志轮转
service: