-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
66 lines (47 loc) · 1.85 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
NODE=node
MOCHA=node_modules/mocha/bin/mocha
KARMA=node_modules/karma/bin/karma
BOURBON=node_modules/bourbon/app/assets/stylesheets
SASS=node_modules/node-sass/bin/node-sass
VIGILIA=node_modules/vigilia/bin/vigilia
WEBPACK=node_modules/webpack/bin/webpack.js
PM2=node_modules/pm2/bin/pm2
GIT=git
.PHONY: deploy-worker run stop logs monit test worker runner scheduler clean-client scripts-client styles-client watch-client
# scheduler & runner tasks
worker: scheduler runner leaderboard
scheduler:
$(NODE) workers/scheduler.js
leaderboard:
$(NODE) workers/leaderboard.js
runner:
$(NODE) workers/runner.js --use_strict
# app tasks
test:
$(MOCHA)
run: build-client
cp -n .env-sample .env || true
export `cat .env| grep -v -e "^#"` && $(PM2)-dev start config/dev.json
stop:
$(PM2) delete config/dev.json
# client tasks
build-client: clean-client scripts-client styles-client images-client
watch-client: build-client
$(VIGILIA) 'client/scripts/**/*.js':'make scripts-client-dev' 'client/styles/**/*.scss':'make styles-client'
clean-client:
rm -fr public
rm -f npm-debug.log
images-client:
cp client/images/thumbnail.png public/thumbnail.png
tree-client:
mkdir -p public/scripts
mkdir -p public/styles
scripts-client: tree-client
$(WEBPACK) --bail -p client/scripts/main.js public/scripts/main.js
$(WEBPACK) --bail -p client/scripts/playground.js public/scripts/playground.js
scripts-client-dev: tree-client
$(WEBPACK) --bail client/scripts/main.js public/scripts/main.js
$(WEBPACK) --bail client/scripts/playground.js public/scripts/playground.js
styles-client: tree-client
$(SASS) --include-path $(BOURBON) --output public/styles --output-style compressed --quiet client/styles/main.scss public/styles/main.css
$(SASS) --include-path $(BOURBON) --output public/styles --output-style compressed --quiet client/styles/playground.scss public/styles/playground.css