-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (64 loc) · 2.32 KB
/
Copy pathMakefile
File metadata and controls
80 lines (64 loc) · 2.32 KB
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
# Extract node version from file .nvmrc and remove the leading 'v'.
NODE_VERSION=$(shell cat .nvmrc|sed 's/^v//')
# Config for local deployment with minikube and helm
LOCAL_DEPLOYMENT:=ctrl-local
LOCAL_CONFIG:=demoMode.enabled=true,$\
userClient.image.repository=docker.io/library/user-client,$\
userClient.image.pullPolicy=Never,$\
adminClient.image.repository=docker.io/library/admin-client,$\
adminClient.image.pullPolicy=Never,$\
backend.image.repository=docker.io/library/backend,$\
backend.image.pullPolicy=Never
.PHONY: help
# Keep 'help' as first target,
help:
@echo "--- List of available targets:"
@echo "- help - print this help message."
@echo "- db - spin up db"
@echo "- db-down - bring down db"
@echo "- clean - bring down docker containers and remove db volume"
@echo "- seed - apply migrations and seed db"
@echo "- kube-start - start minikube cluster"
@echo "- kube-delete - delete minikube cluster"
@echo "- docker - build local docker images"
@echo "- install - local helm deployment"
@echo "- upgrade - local helm upgrade"
@echo "- uninstall - local helm remove deployment"
@echo "---"
# Check everything that will run in ci
check:
yarn workspace backend build
yarn type-check
yarn format
yarn lint
yarn test
make e2e
db:
NODE_VERSION=$(NODE_VERSION) docker compose up -d db
NODE_VERSION=$(NODE_VERSION) docker compose up -d admin
db-down:
NODE_VERSION=$(NODE_VERSION) docker compose down
seed:
yarn prisma:migrate
yarn prisma:seed
clean: db-down
NODE_VERSION=$(NODE_VERSION) docker volume rm ctrl-next_ctrl-db
# Local deployment via minikube and helm
# Build images
kube-start:
minikube start
kube-delete:
minikube delete
docker:
eval $$(minikube -p minikube docker-env) && \
docker build --build-arg NODE_VERSION=$(NODE_VERSION) -t user-client -f application/user-client/Dockerfile . && \
docker build --build-arg NODE_VERSION=$(NODE_VERSION) -t admin-client -f application/admin-client/Dockerfile . && \
docker build --build-arg NODE_VERSION=$(NODE_VERSION) -t backend -f application/backend/Dockerfile .
install:
helm install $(LOCAL_DEPLOYMENT) .helm/ctrl \
--set $(LOCAL_CONFIG)
upgrade:
helm upgrade $(LOCAL_DEPLOYMENT) .helm/ctrl \
--set $(LOCAL_CONFIG)
uninstall:
helm uninstall $(LOCAL_DEPLOYMENT)