-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (48 loc) · 1.61 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
SHELL := /bin/bash
ENV_FILES := --env-file ./src/front_end/.env.dev --env-file ./src/back_end/.env.dev
build: down
podman-compose $(ENV_FILES) build
build-frontend:
podman-compose $(ENV_FILES) build frontend
build-backend:
podman-compose $(ENV_FILES) build backend
up-b: build
podman-compose $(ENV_FILES) up
up:
podman-compose $(ENV_FILES) up
down:
podman-compose $(ENV_FILES) down
clean: down
podman system prune -f
pod-create:
podman pod create --name portfolio-pod -p 5173:5173 -p 10000:10000
pod-build: pod-create
podman build -t frontend -f src/front_end/Dockerfile .
podman build -t backend -f src/back_end/Dockerfile .
pod-run:
podman pod exists portfolio-pod || $(MAKE) pod-create
podman run -d --pod portfolio-pod \
--env-file ./src/front_end/.env.dev \
--name frontend --replace frontend
podman run -d --pod portfolio-pod \
--env-file ./src/back_end/.env.dev \
--name backend --replace backend
pod-stop:
podman pod stop portfolio-pod
pod-down: pod-stop
podman pod rm portfolio-pod
kube-up:
kubectl get namespace portfolio || kubectl apply -f k8s/namespace.yaml
@echo "Checking namespace 'portfolio' status..."
@sleep 2 # Small delay to allow status update
@if kubectl get namespace portfolio -o jsonpath='{.status.phase}' | grep -q Active; then \
echo "Namespace 'portfolio' is Active."; \
else \
echo "Waiting for namespace 'portfolio' to become Active..."; \
kubectl wait --for=condition=Active namespace/portfolio --timeout=60s || { \
echo "Namespace 'portfolio' did not become Active within timeout."; exit 1; \
} \
fi
kubectl apply -f k8s/
kube-down:
kubectl delete namespace portfolio