From dbb546648580f71088b33ae14667f439b1ab5c4b Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Thu, 23 Feb 2023 10:21:20 +0100 Subject: [PATCH] added systemd deployment method --- systemd.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 systemd.mk diff --git a/systemd.mk b/systemd.mk new file mode 100644 index 0000000..9a3f70e --- /dev/null +++ b/systemd.mk @@ -0,0 +1,17 @@ +pull-systemd: + # nop + +start-systemd: + @- echo "\n### start" + @- $(foreach host,$(DEPLOY_HOSTS), \ + echo "$(host)"; \ + ssh $(SSH_USER)@$(host) "cp systemd.service /etc/systemd/system/$(DEPLOY_NAME).service; systemctl daemon-reload; systemctl enable $(DEPLOY_NAME).service; systemctl start $(DEPLOY_NAME).service; wait 5; systemctl status $(DEPLOY_NAME).service"; \ + ) + +stop-systemd: + $- echo "\n### stop" + @- $(foreach host,$(DEPLOY_HOSTS), \ + echo "$(host)"; \ + ssh $(SSH_USER)@$(host) "systemctl stop $(DEPLOY_NAME).service; systemctl disable $(DEPLOY_NAME).service"; \ + ) +