Commit | Line | Data |
---|---|---|
7dde0b73 | 1 | PROJECT_NAME?=evse |
7f774a55 | 2 | NAME:=e-mobility-charging-stations-simulator |
bfcad885 | 3 | SUBMODULES_INIT?=false |
7dde0b73 JB |
4 | DOCKER_ECR_ACCOUNT_ID?=166296450311 |
5 | DOCKER_ECR_REGION?=eu-west-3 | |
7f774a55 | 6 | DOCKER_ECR_REGISTRY_NAME?=e-mobility-charging-stations-simulator |
7dde0b73 JB |
7 | DOCKER_ECR_TAG?=latest |
8 | ||
9 | .PHONY: all | |
10 | ||
11 | default: all | |
12 | ||
13 | submodule-update: | |
14 | git submodule update --init --recursive | |
15 | ||
1355b83a JB |
16 | submodules-init= |
17 | ifeq '$(SUBMODULES_INIT)' 'true' | |
18 | submodules-init += submodule-update | |
19 | endif | |
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 | ||
27 | all: $(NAME) | |
28 | ||
29 | clean-images: | |
e0a40c22 | 30 | -docker rmi $(PROJECT_NAME)-$(NAME) |
7dde0b73 JB |
31 | |
32 | clean-containers: | |
33 | -docker-compose -p $(PROJECT_NAME) down | |
34 | ||
35 | clean: clean-containers clean-images | |
36 | ||
37 | docker-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 | |
40 | docker-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 | ||
44 | dist-clean-images: | |
45 | docker image prune -a -f | |
46 | ||
47 | dist-clean-volumes: | |
48 | docker volume prune -f | |
49 | ||
50 | dist-clean: clean-containers dist-clean-volumes dist-clean-images |