-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
86 lines (64 loc) · 2.11 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
include config.mk
MOCHA = node_modules/mocha/bin/mocha
MOCHACMD = $(MOCHA) --ui tdd -R spec
HOMEDIR = $(shell pwd)
SSHCMD = ssh $(USER)@$(SERVER)
PRIVSSHCMD = ssh $(PRIVUSER)@$(SERVER)
PROJECTNAME = godtributes
APPDIR = /opt/$(PROJECTNAME)
test: test-exhort test-analyze-tweet-images
$(MOCHACMD) tests/tributedemander-tests.js
test-exhort:
$(MOCHA) --R spec tests/exhort-tests.js -t 6000
node tests/exhort-image-tests.js
test-exhort-integration:
node tests/integration/exhort-tweet-test.js
test-chronicler-stress:
node tests/integration/chronicler-stress-test.js
debug-test:
node_modules/mocha/bin/mocha debug --ui tdd -R spec tests/tributedemander-tests.js
node_modules/mocha/bin/mocha debug --ui tdd -R spec tests/topicpool-tests.js
test-analyze-tweet-images:
node tests/analyze-tweet-images-tests.js
start-exhortation-server:
service godtributes start
stop-exhortation-server:
service godtributes stop
sync:
rsync -a $(HOMEDIR) $(USER)@$(SERVER):/opt/ --exclude node_modules/ --exclude data/
$(SSHCMD) "cd $(APPDIR) && chmod u+x exhortationserver.js && \
npm install"
#$(PRIVSSHCMD) "systemctl restart $(PROJECTNAME)"
check-status:
$(SSHCMD) "systemctl status $(PROJECTNAME)"
check-log:
$(SSHCMD) "journalctl -r -u $(PROJECTNAME)" | more
stop:
$(PRIVSSHCMD) "service godtributes stop"
start:
$(PRIVSSHCMD) "service godtributes start"
# The idea is for the repo's post-receive hook to simply be:
# cd /var/www/godtributes && make post-receive
install-logrotate-conf:
cp $(HOMEDIR)/admin/logrotate.conf_entry /etc/logrotate.d/godtributes
# Probably need sudo for this.
install-service:
$(PRIVSSHCMD) "cp $(APPDIR)/$(PROJECTNAME).service /etc/systemd/system && \
systemctl daemon-reload"
# systemctl enable godtributes
# systemctl start godtributes
tribute:
node maketribute.js
update-iscool-and-chime-in:
git pull origin master && \
npm update --save iscool && \
npm update --save can-i-chime-in && \
git commit -a -m"Updated iscool and can-i-chime-in." && \
make pushall
pushall: stop sync
git push origin master && \
make start
lint:
eslint .
prettier:
prettier --single-quote --write "**/*.js"