forked from applieddataconsultants/node-slides
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (32 loc) · 1.21 KB
/
Makefile
File metadata and controls
36 lines (32 loc) · 1.21 KB
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
.PHONY: deploy watch clean touch
project=node-slides
path=/var/www/node-slides
instance=\033[36;01m${project}\033[m
all: watch
deploy: server = sawyer@172.25.16.130
deploy:
@coffee -c app.coffee
@rsync -az --exclude=".git" --exclude="node_modules/*/build" --delete --delete-excluded * ${server}:${path}
@echo " ${instance} | copied files to ${server}"
@ssh ${server} "cd ${path} && npm rebuild"
@echo " ${instance} | built npm packages on ${server}"
@ssh ${server} "sudo cp -f ${path}/upstart.conf /etc/init/${project}.conf"
@echo " ${instance} | setting up upstart on ${server}"
@ssh ${server} "sudo restart ${project}"
@echo " ${instance} | restarting app on ${server}"
@make -s clean
@sleep 1
@make -s touch
touch: server = sawyer@172.25.20.130
touch:
@wget -r -l 1 -q http://slides.wavded.com/
@echo " ${instance} | built main assets on ${server}"
@wget -r -l 1 -q http://slides.wavded.com/clicker
@echo " ${instance} | built clicker assets on ${server}"
@rm -rf slides.wavded.com
watch:
@if ! which supervisor > /dev/null; then echo "supervisor required, installing..."; sudo npm install -g supervisor; fi
@supervisor -w assets,view,app.coffee app.coffee
clean:
@rm app.js
@echo " ${instance} | cleaned"