Files
webp/Makefile
2024-11-07 01:49:53 +08:00

44 lines
1.1 KiB
Makefile

export HOST=ai
# 运行本地开发环境(使用SSH隧道代理端口)
dev:
@if ! go list -m github.com/air-verse/air@latest >/dev/null 2>&1; then \
echo "github.com/air-verse/air@latest is not installed. Installing..."; \
go get github.com/air-verse/air@latest; \
fi;
@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
link:
ssh -NCPf main -L 3306:localhost:3306 -L 19530:localhost:19530
# 编译项目
build:
go mod tidy
go build -o dist/main bin/main.go
# 更新部署到服务器
update: build
scp dist/main $(HOST):~/webp/main
rm -rf dist
# 设为系统服务和设置日志轮转
service:
sudo cp webp.service /etc/systemd/system/webp.service
sudo systemctl enable webp
sudo cp webp.logrotate /etc/logrotate.d/webp
# 安装 zinc
# 安装 gorse
gorse:
export GORSE_DASHBOARD_USER="gorse"
export GORSE_DASHBOARD_PASS="gorse"
curl -fsSL https://gorse.io/playground | bash
# 安装搜图服务 python embedding
reverse:
git clone