forked from amigocloud/modified-tripplanner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (40 loc) · 1.45 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
CSS = $(shell find client -name '*.css')
HTML = $(shell find client -name '*.html')
CLIENTJS = $(shell find client -name '*.js')
LIBJS = $(shell find lib -name '*.js')
TESTJS = $(shell find test -name '*.js')
JSON = $(shell find client -name '*.json')
RB = $(shell find cookbooks -name '*.rb')
BUCKET = $(shell bin/config-val $(NODE_ENV) s3_bucket)
build-client: $(CSS) $(HTML) $(CLIENTJS) $(JSON)
@bin/build-client $(NODE_ENV)
beautify:
@node_modules/.bin/js-beautify \
--config config/jsbeautify.json \
--replace $(CLIENTJS) $(LIBJS) $(TESTJS) \
--quiet
assets/cookbooks.tar.gz: $(RB)
@tar cvzf assets/cookbooks.tar.gz cookbooks
assets/server.tar.gz: $(LIBJS)
@git archive --output=assets/server.tar HEAD
@tar -rvf assets/server.tar deployment/config.yaml # Add the config to the archvie before gzipping
@gzip -c assets/server.tar > assets/server.tar.gz
@rm assets/server.tar # cleanup
install:
@bin/install
# Lint JavaScript with JSHint
lint:
@node_modules/.bin/jshint \
--config config/jshint.json $(CLIENTJS) $(LIBJS) $(TESTJS)
# Reinstall if package.json has changed
node_modules: package.json
@npm install
# Watch & reload server
serve:
@nohup bin/server > server.log </dev/null & echo "$$!" > server.pid
@echo "Logs stored in server.log"
stop:
@[ -f server.pid ] && kill `cat server.pid`
sync: assets/cookbooks.tar.gz assets/server.tar.gz build-client
@aws s3 sync assets $(BUCKET) --acl public-read
.PHONY: beautify build install lint serve