-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (41 loc) · 1.51 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
TAG := $(shell git log --format=%h -1)
GEOAPI_IMAGE=taccaci/geoapi
GEOAPI_WORKERS=taccaci/geoapi-workers
.PHONY: help
help: ## Display this help screen
@grep -E '^([a-zA-Z_-]+):.*?## .*$$|^([a-zA-Z_-]+):' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {if ($$2) {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2} else {printf "\033[36m%-30s\033[0m %s\n", $$1, "(no description)"}}'
.PHONY: start
start:
docker compose -f devops/docker-compose.local.yml --env-file .env up
.PHONY: stop
stop:
docker compose -f devops/docker-compose.local.yml --env-file .env down
.PHONY: restart-workers
restart-workers: ## Restart workers
docker compose -f devops/docker-compose.local.yml --env-file .env restart workers
.PHONY: restart-nginx
restart-nginx: ## Restart nginx
docker compose -f devops/docker-compose.local.yml --env-file .env restart nginx
.PHONY: build
build:
make geoapi && make workers
.PHONY: geoapi
geoapi:
docker build -t $(GEOAPI_IMAGE):$(TAG) -f devops/Dockerfile .
docker tag $(GEOAPI_IMAGE):$(TAG) $(GEOAPI_IMAGE):latest
docker tag $(GEOAPI_IMAGE):$(TAG) $(GEOAPI_IMAGE):local
.PHONY: workers
workers:
docker build -t $(GEOAPI_WORKERS):$(TAG) -f devops/Dockerfile.worker .
docker tag $(GEOAPI_WORKERS):$(TAG) $(GEOAPI_WORKERS):latest
docker tag $(GEOAPI_WORKERS):$(TAG) $(GEOAPI_WORKERS):local
.PHONY: deploy
deploy:
make deploy-geoapi && make deploy-workers
.PHONY: deploy-geoapi
deploy-geoapi:
docker push $(GEOAPI_IMAGE):$(TAG)
.PHONY: deploy-workers
deploy-workers:
docker push $(GEOAPI_WORKERS):$(TAG)