aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-11-14 13:29:30 +0700
committerShulhan <ms@kilabit.info>2021-11-14 13:29:30 +0700
commit6ad34830510689cd33f4cdc395f8ea22be323c81 (patch)
tree94e3961ad075a101679d99a70703c0ced4921362 /Makefile
parent305190a2b2236f74aab7955b85a7933dac6de2d6 (diff)
downloadrescached-6ad34830510689cd33f4cdc395f8ea22be323c81.tar.xz
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files 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"