简化更新
This commit is contained in:
		
							
								
								
									
										9
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user