refactor(simulator): avoid branching in empty array helpers
[e-mobility-charging-stations-simulator.git] / docker / Makefile
CommitLineData
7dde0b73 1PROJECT_NAME?=evse
7f774a55 2NAME:=e-mobility-charging-stations-simulator
bfcad885 3SUBMODULES_INIT?=false
7dde0b73
JB
4DOCKER_ECR_ACCOUNT_ID?=166296450311
5DOCKER_ECR_REGION?=eu-west-3
7f774a55 6DOCKER_ECR_REGISTRY_NAME?=e-mobility-charging-stations-simulator
7dde0b73
JB
7DOCKER_ECR_TAG?=latest
8
9.PHONY: all
10
11default: all
12
13submodule-update:
14 git submodule update --init --recursive
15
1355b83a
JB
16submodules-init=
17ifeq '$(SUBMODULES_INIT)' 'true'
18 submodules-init += submodule-update
19endif
20
21$(NAME): $(submodules-init)
7dde0b73
JB
22 docker-compose -p $(PROJECT_NAME) up -d
23
1355b83a 24$(NAME)-force: $(submodules-init)
7dde0b73
JB
25 docker-compose -p $(PROJECT_NAME) up -d --build --force-recreate
26
27all: $(NAME)
28
29clean-images:
e0a40c22 30 -docker rmi $(PROJECT_NAME)-$(NAME)
7dde0b73
JB
31
32clean-containers:
33 -docker-compose -p $(PROJECT_NAME) down
34
35clean: clean-containers clean-images
36
37docker-tag-ecr:
051963ac 38 docker tag $(PROJECT_NAME)-$(NAME) $(DOCKER_ECR_ACCOUNT_ID).dkr.ecr.$(DOCKER_ECR_REGION).amazonaws.com/$(DOCKER_ECR_REGISTRY_NAME):$(DOCKER_ECR_TAG)
7dde0b73
JB
39
40docker-push-ecr: $(NAME)-force docker-tag-ecr
41 aws ecr get-login-password --region $(DOCKER_ECR_REGION) | docker login --username AWS --password-stdin $(DOCKER_ECR_ACCOUNT_ID).dkr.ecr.$(DOCKER_ECR_REGION).amazonaws.com/$(DOCKER_ECR_REGISTRY_NAME)
42 docker push $(DOCKER_ECR_ACCOUNT_ID).dkr.ecr.$(DOCKER_ECR_REGION).amazonaws.com/$(DOCKER_ECR_REGISTRY_NAME):$(DOCKER_ECR_TAG)
43
44dist-clean-images:
45 docker image prune -a -f
46
47dist-clean-volumes:
48 docker volume prune -f
49
50dist-clean: clean-containers dist-clean-volumes dist-clean-images