forked from applieddataconsultants/wheredat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (31 loc) · 1.29 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
project=wheredat
instance=\033[36;01m${project}\033[m
all: tmux
watch:
@if ! which supervisor > /dev/null; then echo "supervisor required, installing..."; sudo npm install -g supervisor; fi
@supervisor -e html,js,css -n exit server.js
tmux_setup:
@tmux new-session -s ${project} -d -n workspace
@tmux split-window -t ${project} -h
@tmux split-window -t ${project} -v
@tmux select-pane -t ${project}:1.0
@tmux select-pane -t ${project}:1.1
@tmux resize-pane -t ${project} -D 2
@tmux select-layout -t ${project} main-vertical
@tmux send-keys -t ${project}:1.0 'vim' C-m
@tmux send-keys -t ${project}:1.2 'make watch' C-m
@tmux select-pane -t ${project}:1.0
@tmux resize-pane -t ${project} -R 40
tmux:
@if ! tmux has-session -t ${project}; then exec make tmux_setup; fi
@tmux attach -t ${project}
# sample deployment script (assumes upstart as daemon)
deploy_live: serverA = [email protected]
deploy_live: serverB = [email protected]
deploy_live:
@ssh ${serverA} "sudo npm install -g ${project}"
@ssh ${serverB} "sudo npm install -g ${project}"
@echo -e " ${instance} | updated ${project} on ${serverA} and ${serverB}"
@ssh ${serverA} "sudo restart ${project}"
@ssh ${serverB} "sudo restart ${project}"
@echo -e " ${instance} | restarting app on ${serverA} and ${serverB}"