-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
94 lines (73 loc) · 1.98 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.PHONY: all install install_client install_server build start stop server devserver client devclient updater major minor patch clean
ENV = production
SERVICE = null
all: install build start
install:
ifeq ($(SERVICE), client)
make install_client
else ifeq ($(SERVICE), server)
make install_server
else
make install_client
make install_server
endif
install_client:
cd raspbot/web && npm install
install_server:
cd raspbot && npm install
build:
cd raspbot && npm run build
start:
pm2 start process.json --only Raspbot --watch
restart:
pm2 restart process.json --only Raspbot
stop:
pm2 stop process.json --only Raspbot --watch 0
server:
ifeq ($(ENV), dev)
cd raspbot && NODE_ENV=development npm run dev
else
cd raspbot && NODE_ENV=production npm run dev
endif
devserver:
make ENV=dev server
client:
ifeq ($(ENV), dev)
cd raspbot && npm run dev:client
else
cd raspbot && npm run build
endif
devclient:
make ENV=dev client
update:
git pull
system_shutdown:
sudo /sbin/shutdown
system_reboot:
sudo /sbin/reboot
major:
ifeq ($(SERVICE), $(filter $(SERVICE),raspbot))
node raspbot/.build/increment-version.js --version=major --skip-build --reset-minor --reset-patch --file=$(SERVICE)/package.json
else
@echo "ERROR:\tCould not increment major version."
@echo "USAGE:\tmake SERVICE=[raspbot] major"
endif
minor:
ifeq ($(SERVICE), $(filter $(SERVICE),raspbot))
node raspbot/.build/increment-version.js --version=minor --skip-build --reset-patch --file=$(SERVICE)/package.json
else
@echo "ERROR:\tCould not increment minor version."
@echo "USAGE:\tmake SERVICE=[raspbot] minor"
endif
patch:
ifeq ($(SERVICE), $(filter $(SERVICE),raspbot))
node raspbot/.build/increment-version.js --version=patch --skip-build --file=$(SERVICE)/package.json
else
@echo "ERROR:\tCould not increment patch version."
@echo "USAGE:\tmake SERVICE=[raspbot] patch"
endif
heroku:
git subtree push --prefix raspbot heroku master
clean:
find . -name \*.pyc -delete
rm -rf raspbot/node_modules/ raspbot/web/node_modules