-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
68 lines (52 loc) · 1.6 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
vendor = vonmo
project = infra
app = rocker
DOCKER = $(shell which docker)
ifeq ($(DOCKER),)
$(error "Docker not available on this system")
endif
DOCKER_CMD = $(shell which docker)
DOCKER_COMPOSE_OLD_CMD = $(shell which docker-compose)
DOCKER_COMPOSE_NEW_CMD = $(shell which docker)
ifeq ($(DOCKER_COMPOSE_NEW_CMD),)
ifeq ($(DOCKER_COMPOSE_OLD_CMD),)
$(error "DockerCompose not available on this system")
else
DOCKER_COMPOSE_CMD = ${DOCKER_COMPOSE_OLD_CMD}
endif
else
DOCKER_COMPOSE_CMD = ${DOCKER_COMPOSE_NEW_CMD} compose
endif
compose-uid := $(shell echo $(vendor)-$(app)-$(notdir $(shell pwd)) | tr A-Z a-z)
compose-prefix = -p ${compose-uid}
DOCKER_COMPOSE=${DOCKER_COMPOSE_CMD} ${compose-prefix}
# use to override vars for your platform
ifeq (env.mk,$(wildcard env.mk))
include env.mk
endif
.PHONY: test
all: build_imgs up test rel
build_imgs:
@echo "Update docker images..."
@${DOCKER_COMPOSE} build
up:
@${DOCKER_COMPOSE} up -d
down:
@${DOCKER_COMPOSE} down
compile:
@${DOCKER_COMPOSE} exec test bash -c "cd /project && make -f sandbox.mk compile"
test:
@echo "Testing..."
@${DOCKER_COMPOSE} exec test bash -c "cd /project && make -f sandbox.mk tests"
rel:
@echo "Build release..."
@${DOCKER_COMPOSE} exec test bash -c "cd /project && make -f sandbox.mk prod"
lint:
@echo "Lint..."
@${DOCKER_COMPOSE} exec test bash -c "cd /project && make -f sandbox.mk lint"
xref:
@echo "Xref analysis..."
@${DOCKER_COMPOSE} exec test bash -c "cd /project && make -f sandbox.mk xref"
dialyzer:
@echo "Dialyzer..."
@${DOCKER_COMPOSE} exec test bash -c "cd /project && make -f sandbox.mk dialyzer"