diff --git a/Makefile b/Makefile index 9d95ad2..144eaa7 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/go.mod b/go.mod index 49bfb1a..a879d4c 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/clbanning/mxj/v2 v2.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/elastic/elastic-transport-go/v8 v8.3.0 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect diff --git a/go.sum b/go.sum index c4300e5..98fe9ed 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=