-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
60 lines (47 loc) · 1.33 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
CONTAINER = campaign_generator
# Check that given variables are set and all have non-empty values,
# die with an error otherwise.
#
# Params:
# 1. Variable name(s) to test.
# 2. (optional) Error message to print.
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
.PHONY: install
build:
$(info Make: Building images.)
@docker-compose build --no-cache
@make -s clean
start:
$(info Make: Starting containers.)
@docker-compose up -d
stop:
$(info Make: Stopping containers.)
@docker-compose stop
restart:
$(info Make: Restarting containers.)
@make -s stop
@make -s start
clean:
@docker system prune --volumes --force
unittest:
$(info Make: Running unit tests.)
@docker-compose exec $(CONTAINER) ng test --watch=false
e2etest:
$(info Make: Running E2E tests.)
@docker-compose exec $(CONTAINER) ng e2e --port 4202
lint:
$(info Make: Linting files)
@docker-compose exec $(CONTAINER) ng lint
log:
@docker-compose logs -f $(CONTAINER)
install:
$(call check_defined, package, package name not specified)
docker exec -it $(CONTAINER) npm install $(package) --save
uninstall:
$(call check_defined, package, package name not specified)
docker exec -it $(CONTAINER) npm uninstall $(package) --save