forked from dfilatov/twitter-trends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
52 lines (42 loc) · 1.08 KB
/
GNUmakefile
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
NODE_MODULES := ./node_modules/
BEM := $(NODE_MODULES).bin/bem
NPM := npm
GITHUB_REPO := git@github.com:dfilatov/twitter-trends.git
HEROKU_REPO := git@heroku.com:twitter-trends.git
ifneq (,$(findstring B,$(MAKEFLAGS)))
BEM_FLAGS := --force
endif
.PHONY: bem-server
bem-server:: $(BEM)
@$(BEM) server --port 3001
$(BEM):: $(NODE_MODULES)
$(NODE_MODULES)::
$(debug ---> Updating npm dependencies)
@$(NPM) install
.PHONY: app-dev
app-dev:
supervisor -w lib,configs,desktop.bundles/index/index.blocks.js boot.js
.PHONY: app
app:
node boot.js
.PHONY: deploy
deploy:
rm -rf deploy
mkdir deploy
cd deploy; \
git clone $(GITHUB_REPO) github; \
git clone $(HEROKU_REPO) heroku; \
cp -r github/{.bem,common.blocks,configs,desktop.{blocks,bundles},lib,Procfile,boot.js,package.json} heroku; \
cd heroku; \
rm -rf bem-bl bemhtml configs/current; \
ln -s production configs/current; \
$(NPM) install -d; \
YENV=production $(BEM) make --force; \
echo "node_modules\n.bem" > .gitignore; \
git add .; \
git ci -m "deploy"; \
git push; \
cd ../..
.PHONY: clean
clean::
$(BEM) make -m clean