From 6ad34830510689cd33f4cdc395f8ea22be323c81 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 14 Nov 2021 13:29:30 +0700 Subject: Makefile: add deploy task, to differentiate with deploy-personal-server Previously, the deploy task is to deploy the new version of rescached to my personal, public server. To make the task names consistent with macos (install-macos, deploy-macos, ...), we rename the deploy to deploy-personal-server; and the deploy task is default to deploying to Linux. --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f0e498a..cceefb9 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,10 @@ .PHONY: test test.prof lint build debug doc .PHONY: install-common uninstall-common -.PHONY: install uninstall +.PHONY: install deploy uninstall .PHONY: install-macos deploy-macos uninstall-macos .PHONY: clean distclean -.PHONY: deploy +.PHONY: deploy-personal-server .FORCE: CGO_ENABLED:=$(shell go env CGO_ENABLED) @@ -130,6 +130,11 @@ uninstall: uninstall-common systemctl disable rescached rm -f /usr/lib/systemd/system/rescached.service +deploy: build + sudo rsync _bin/$(GOOS)_$(GOARCH)/rescached $(DIR_BIN)/ + sudo rsync _bin/$(GOOS)_$(GOARCH)/resolver $(DIR_BIN)/ + sudo systemctl restart rescached + ## ## Tasks for installing and uninstalling service on macOS ## @@ -163,5 +168,6 @@ build-linux-amd64: GOOS=linux build-linux-amd64: GOARCH=amd64 build-linux-amd64: build -deploy: build-linux-amd64 +deploy-personal-server: build-linux-amd64 rsync --progress _bin/linux_amd64/rescached personal-server:~/bin/rescached + ssh personal-server "sudo rsync ~/bin/rescached /usr/bin/rescached; sudo systemctl restart rescached.service" -- cgit v1.3