-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
36 lines (27 loc) · 868 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PROJECTNAME = slack-gis
HOMEDIR = $(shell pwd)
USER = bot
PRIVUSER = root
SERVER = smidgeo
SSHCMD = ssh $(USER)@$(SERVER)
PRIVSSHCMD = ssh $(PRIVUSER)@$(SERVER)
APPDIR = /opt/$(PROJECTNAME)
pushall: sync set-permissions restart-remote
git push origin master
sync:
rsync -a $(HOMEDIR) $(USER)@$(SERVER):/opt/ --exclude node_modules/ --exclude data/
$(SSHCMD) "cd $(APPDIR) && npm install"
set-permissions:
$(SSHCMD) "chmod +x $(APPDIR)/slack-gis.js"
update-remote: sync set-permissions restart-remote
restart-remote:
$(PRIVSSHCMD) "service $(PROJECTNAME) restart"
stop:
$(PRIVSSHCMD) "service $(PROJECTNAME) stop"
install-service:
$(PRIVSSHCMD) "cp $(APPDIR)/$(PROJECTNAME).service /etc/systemd/system && \
systemctl enable $(PROJECTNAME)"
check-status:
$(SSHCMD) "systemctl status $(PROJECTNAME)"
check-log:
$(SSHCMD) "journalctl -u $(PROJECTNAME)"