Makefile 2.07 KB
Newer Older
François Agneray's avatar
François Agneray committed
1
2
UID := 1000
GID := 1000
3
NAME_APP=anis-admin
François Agneray's avatar
François Agneray committed
4
5
6
7
8

list:
	@echo ""
	@echo "Useful targets:"
	@echo ""
9
10
11
12
13
14
15
16
17
18
19
20
	@echo "  install       > install node modules dependancies (node_modules)"
	@echo "  start         > run a dev server for $(NAME_APP) application (in memory)"
	@echo "  stop          > stop the dev server for $(NAME_APP) application"
	@echo "  restart       > restart the dev server for $(NAME_APP) (container)"
	@echo "  status        > display $(NAME_APP) container status"
	@echo "  test          > run $(NAME_APP) tests"
	@echo "  test-watch    > run $(NAME_APP) tests on every file change"
	@echo "  report        > open the code coverage report in a browser (only available for Linux)"
	@echo "  build         > generate the angular dist application (html, css, js)"
	@echo "  build-sdb-lam > generate the angular dist application (SDB LAM Prod Version)"
	@echo "  logs          > display $(NAME_APP) container logs"
	@echo "  shell         > shell into $(NAME_APP) container"
François Agneray's avatar
François Agneray committed
21
22
23
24
25
26
27
28
29
	@echo ""

install:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	-v $(CURDIR):/project \
	-w /project anis-node yarn install

start:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
30
	--name $(NAME_APP) \
François Agneray's avatar
François Agneray committed
31
32
33
34
35
	-p 4201:4201 \
	-v $(CURDIR):/project -d \
	-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4201

stop:
36
	@docker stop $(NAME_APP)
François Agneray's avatar
François Agneray committed
37
38
39

restart: stop start

40
status:
41
	@docker ps -f name=$(NAME_APP)
42
43

test:
44
	@docker exec -ti $(NAME_APP) ng test --no-watch
45

Tifenn Guillas's avatar
Tifenn Guillas committed
46
47
48
49
50
51
test-watch:
	@docker exec -ti $(NAME_APP) ng test

report:
	xdg-open var/coverage/index.html

Tifenn Guillas's avatar
Tifenn Guillas committed
52
build:
François Agneray's avatar
François Agneray committed
53
54
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	-v $(CURDIR):/project \
55
	-w /project anis-node ng build --prod --base-href /admin/
François Agneray's avatar
François Agneray committed
56

57
58
59
60
61
build-sdb-lam:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	-v $(CURDIR):/project \
	-w /project anis-node ng build --configuration=sdb-lam --base-href /sdb/admin/

62
logs:
63
	@docker logs -f -t $(NAME_APP)
François Agneray's avatar
François Agneray committed
64

65
shell:
66
	@docker exec -ti $(NAME_APP) bash