-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 904 Bytes
/
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
# Load environment variables from .env
ifneq ($(wildcard .env),)
include .env
export $(shell sed 's/=.*//' .env)
endif
up:
docker-compose -f docker-compose.yml up -d
build:
docker-compose -f docker-compose.yml up --build -d
down:
docker-compose -f docker-compose.yml down
rebuild:
@$(MAKE) down
@$(MAKE) build
check-local-k8s-connected:
if [ "$$(kubectl config current-context)" = "docker-desktop" ]; then \
echo "Successfully switched to docker-desktop context."; \
else \
echo "Failed to switch to docker-desktop context."; \
exit 1; \
fi
k8s-local-up:
@$(MAKE) check-local-k8s-connected
kubectl apply -k k8s/local
k8s-local-down:
kubectl delete -k k8s/local
k8s-prod-spinup:
gcloud container clusters get-credentials $(KUBERNETES_CLUSTER) --zone $(KUBERNETES_CLUSTER_ZONE)
kustomize build k8s/gke | envsubst | kubectl apply -f -
k8s-prod-down:
kubectl delete -k k8s/gke