-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
94 lines (63 loc) · 1.58 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
DOCKER_COMPOSE?=docker-compose
# Node
EXEC?=$(DOCKER_COMPOSE) exec $(TTY) node
NODE?=node
GANACHE?=$(EXEC) ./node_modules/.bin/ganache
TRUFFLE?=$(EXEC) ./node_modules/.bin/truffle
NPM?=$(EXEC) npm
NPX?=$(EXEC) npx
SOLIUM?=$(EXEC) ./node_modules/.bin/solium
ESLINT?=$(EXEC) ./node_modules/.bin/eslint
# React
REACT_EXEC?=$(DOCKER_COMPOSE) exec $(TTY) react
REACT_NPM?=$(REACT_EXEC) npm
## DOCKER
.PHONY: build
build:
$(DOCKER_COMPOSE) pull --parallel --ignore-pull-failures
$(DOCKER_COMPOSE) build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) --pull --force-rm
up:
$(DOCKER_COMPOSE) up -d --remove-orphans
install: build up node_modules
stop:
$(DOCKER_COMPOSE) kill -s SIGINT
$(DOCKER_COMPOSE) rm -v --force
restart: stop up
reset: stop install
install: up
$(DOCKER_COMPOSE) up -d
.PHONY: ganache truffle-init truffle-migrate truffle-test node_modules
sh:
$(EXEC) sh
## NODE
node_modules:
$(NPM) install
$(NPM) install -g [email protected]
## TRUFFLE
truffle-init: truffle-config.js
truffle-config.js:
touch truffle-config.js
$(TRUFFLE) init
truffle-migrate:
$(TRUFFLE) migrate --network docker
truffle-migrate-reset:
$(TRUFFLE) migrate --network docker --reset
truffle-test:
$(TRUFFLE) test --network docker
truffle-compile:
$(TRUFFLE) compile --network docker
## LINT
lint: eslint solium
solium:
$(SOLIUM) --dir ./contracts/
soliumfix:
$(SOLIUM) --dir ./contracts/ --fix
eslint:
$(ESLINT) . --ext .js
eslintfix:
$(ESLINT) . --ext .js --fix
## REACT
react-build: truffle-compile
$(REACT_NPM) run build
react-start: truffle-compile
$(REACT_NPM) run start