-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
94 lines (71 loc) · 2.91 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL := /bin/bash
# ==============================================================================
# variables
# ==============================================================================
METADATA_VERSION := 1.0.0
# ==============================================================================
# run
# ==============================================================================
tidy:
go mod tidy
go mod vendor
run-movie:
INFRA_CONFIG_FILE=configs/base.yaml APP_CONFIG_FILE=metadata/configs/base.yaml \
go run movie/cmd/*.go
run-metadata:
INFRA_CONFIG_FILE=configs/base.yaml APP_CONFIG_FILE=metadata/configs/base.yaml \
go run metadata/cmd/main.go | zap-pretty --all
run-rating:
INFRA_CONFIG_FILE=configs/base.yaml APP_CONFIG_FILE=metadata/configs/base.yaml \
go run rating/cmd/*.go
# ==============================================================================
# docker
# ==============================================================================
docker-build-metadata:
sudo docker build \
-f docker/dockerfile/Dockerfile \
-t ashkanmaleki/metadata:$(METADATA_VERSION) \
--build-arg service=metadata \
--build-arg BUILD_REF=$(METADATA_VERSION) \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
.
docker-build: docker-build-metadata
docker-logs-metadata:
sudo docker logs metadata -f --tail=100 | zap-pretty --all
# ==============================================================================
# docker compose
# ==============================================================================
compose-env-update:
cd docker/compose/app; echo "METADATA_VERSION=$(METADATA_VERSION)" > .env
compose-up: compose-env-update
docker compose -f docker/compose/app/docker-compose.yaml \
-f docker/compose/app/docker-compose.override.yaml \
--env-file docker/compose/app/.env \
up -d
compose-down:
docker compose -f docker/compose/app/docker-compose.yaml \
-f docker/compose/app/docker-compose.override.yaml \
--env-file docker/compose/app/.env \
down
compose-build-metadata: docker-build-metadata compose-down compose-up
compose-rebuild-metadata: compose-stop docker-build-metadata compose-start
compose-monitor-up:
docker compose -f docker/compose/monitor/docker-compose.yaml \
-f docker/compose/monitor/docker-compose.override.yaml \
up -d
compose-monitor-down:
docker compose -f docker/compose/monitor/docker-compose.yaml \
-f docker/compose/monitor/docker-compose.override.yaml \
down
compose-infra-up:
docker compose -f docker/compose/infra/docker-compose.yaml \
-f docker/compose/infra/docker-compose.override.yaml \
up -d
compose-infra-down:
docker compose -f docker/compose/infra/docker-compose.yaml \
-f docker/compose/infra/docker-compose.override.yaml \
down
compose-start: compose-monitor-up compose-infra-up compose-up
compose-stop: compose-down compose-infra-down
compose-restart: compose-stop compose-start
compose-shutdown: compose-monitor-down compose-stop