-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 893 Bytes
/
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
SHELL=/bin/sh
CONTAINER_NAME=test_redis
define up_if_down
@if [ ! `docker ps -q -f name=$(CONTAINER_NAME)` ]; then echo "Bringing up containers\n--------" && docker-compose up; fi
endef
define compile
cd ballot && go build -o ../bin/ballot
endef
rebuild:
npm install
$(call compile)
./node_modules/.bin/webpack --mode=development
build:
npm ci
$(call compile)
./node_modules/.bin/webpack --mode=development
build_prod:
npm ci
$(call compile)
./node_modules/.bin/webpack --mode=production
compile:
$(call compile)
run:
$(call up_if_down)
$(call compile)
@cd ballot && ENV=development ../bin/ballot
up:
$(call up_if_down)
down:
@docker-compose down
test:
$(call up_if_down)
$(call compile)
@cd ballot && REDIS_URL=redis://localhost:6380 go test -v
@echo "-------\nRun 'make down' to stop test containers..."
ps:
@docker-compose ps
logs:
@docker-compose logs -f