Skip to content
Snippets Groups Projects
Makefile 1.61 KiB
Newer Older
UID := $(id -u)
GID := $(id -g)
François Agneray's avatar
François Agneray committed

# UID := 1000
# GID := 1000
François Agneray's avatar
François Agneray committed

list:
	@echo ""
	@echo "Useful targets:"
	@echo ""
	@echo "  install      > install node modules dependancies (node_modules)"
	@echo "  start        > run a dev server for anis client application (in memory)"
	@echo "  stop         > stop the dev server for anis client application"
	@echo "  restart      > restart the dev server for anis client (container)"
Tifenn Guillas's avatar
Tifenn Guillas committed
	@echo "  test         > run anis client tests"
François Agneray's avatar
François Agneray committed
	@echo "  ng-build     > generate the angular dist application (html, css, js)"
	@echo "  log          > display anis client container logs"
Tifenn Guillas's avatar
Tifenn Guillas committed
	@echo "  shell        > shell into anis client container"
François Agneray's avatar
François Agneray committed
	@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) \
	--name anis-client \
	-p 4200:4200 \
Tifenn Guillas's avatar
Tifenn Guillas committed
	-p 9876:9876 \
François Agneray's avatar
François Agneray committed
	-v $(CURDIR):/project -d \
	-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200

restart: stop start
François Agneray's avatar
François Agneray committed

stop:
	@docker stop anis-client

restart: stop start

Tifenn Guillas's avatar
Tifenn Guillas committed
test:
	rm -rf ./coverage
Tifenn Guillas's avatar
Tifenn Guillas committed
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	--name anis-client \
	-p 9876:9876 \
	-v $(CURDIR):/project -d \
	-w /project anis-node ng test --code-coverage
Tifenn Guillas's avatar
Tifenn Guillas committed

François Agneray's avatar
François Agneray committed
ng-build:
	@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
	-v $(CURDIR):/project \
	-w /project anis-node ng build --prod

log:
	@docker logs -f -t anis-client

Tifenn Guillas's avatar
Tifenn Guillas committed
shell:
François Agneray's avatar
François Agneray committed
	@docker exec -ti anis-client bash