forked from keystonejs/keystone-test-project
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmakefile
42 lines (33 loc) · 1.19 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
P="\\033[32m[+]\\033[0m"
MONGODB?=mongodb://localhost:27017/plate
KEYSTONE_DEV=true
CLIENT_SOCKETIO_PORT?=3030
CLIENT_SOCKETIO_HOST?=localhost
CLIENT_SOCKETIO_PROTOCOL?=http
SERVER_SOCKETIO_PORT?=3030
help:
@echo "$(P) make dev"
@echo "to start server in development mode"
@echo "$(P) make start"
@echo "to start server in production mode"
@echo "$(P) make build-config"
@echo "to build config on demand"
build-keystone-plugin:
@echo "build keystone plugin JS bundle"
NODE_ENV=production SOCKETIO_PROTOCOL=$(CLIENT_SOCKETIO_PROTOCOL) SOCKETIO_HOST=$(CLIENT_SOCKETIO_HOST) SOCKETIO_PORT=$(CLIENT_SOCKETIO_PORT) node build-keystone-plugin.js
build-config:
@echo "build config on demand"
@node build-config
build-config-if-needed:
ifeq (,$(wildcard ./config.js))
@echo "build config on demand"
@node build-config
endif
dev:build-config-if-needed
@echo "$(P) NODE_ENV=development KEYSTONE_DEV=$(KEYSTONE_DEV) node keystone"
NODE_ENV=development KEYSTONE_DEV=$(KEYSTONE_DEV) node keystone
start:build-config-if-needed
NODE_ENV=production SOCKETIO_PORT=$(SERVER_SOCKETIO_PORT) node keystone
clean:
@rm ./config.js
.PHONY: help dev start build-config clean build-config-if-needed build-keystone-plugin