-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
54 lines (47 loc) · 2.68 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
PROJECT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
VERSION := v0.1
.PHONY: generate-webapp
generate-webapp:
@echo "Generating webapp..."
@cd $(PROJECT_DIR)frontend/webapp && yarn && yarn build
rm -rf $(PROJECT_DIR)/frontend/src/main/resources/static/*
cp -r $(PROJECT_DIR)frontend/webapp/out/* $(PROJECT_DIR)/frontend/src/main/resources/static/
.PHONY: build-images
build-images:
@echo "Building images..."
docker build -t dev/frontend:dev $(PROJECT_DIR)frontend -f $(PROJECT_DIR)frontend/Dockerfile
docker build -t dev/inventory:dev $(PROJECT_DIR)inventory -f $(PROJECT_DIR)inventory/Dockerfile
docker build -t dev/pricing:dev $(PROJECT_DIR)pricing -f $(PROJECT_DIR)pricing/Dockerfile
docker build -t dev/coupon:dev $(PROJECT_DIR)coupon -f $(PROJECT_DIR)coupon/Dockerfile
docker build -t dev/membership:dev $(PROJECT_DIR)membership -f $(PROJECT_DIR)membership/Dockerfile
.PHONY: load-to-kind
load-to-kind:
@echo "Loading images to kind..."
kind load docker-image dev/frontend:dev
kind load docker-image dev/inventory:dev
kind load docker-image dev/pricing:dev
kind load docker-image dev/coupon:dev
kind load docker-image dev/membership:dev
.PHONY: deploy
deploy:
@echo "Deploying to Kubernetes..."
kubectl apply -f $(PROJECT_DIR)pricing/deployment/
kubectl apply -f $(PROJECT_DIR)inventory/deployment/
kubectl apply -f $(PROJECT_DIR)frontend/deployment/
kubectl apply -f $(PROJECT_DIR)coupon/deployment/
kubectl apply -f $(PROJECT_DIR)membership/deployment/
.PHONY: build-push-images-prod
build-push-images-prod:
@echo "Building images..."
docker buildx build -t keyval/odigos-demo-frontend:${VERSION} $(PROJECT_DIR)frontend -f $(PROJECT_DIR)frontend/Dockerfile --platform linux/amd64,linux/arm64 --push
docker buildx build -t keyval/odigos-demo-inventory:${VERSION} $(PROJECT_DIR)inventory -f $(PROJECT_DIR)inventory/Dockerfile --platform linux/amd64,linux/arm64 --push
docker buildx build -t keyval/odigos-demo-pricing:${VERSION} $(PROJECT_DIR)pricing -f $(PROJECT_DIR)pricing/Dockerfile --platform linux/amd64,linux/arm64 --push
docker buildx build -t keyval/odigos-demo-coupon:${VERSION} $(PROJECT_DIR)coupon -f $(PROJECT_DIR)coupon/Dockerfile --platform linux/amd64,linux/arm64 --push
docker buildx build -t keyval/odigos-demo-membership:${VERSION} $(PROJECT_DIR)membership -f $(PROJECT_DIR)membership/Dockerfile --platform linux/amd64,linux/arm64 --push
.PHONY: deploy-membership
deploy-membership:
@echo "Deploying membership to Kubernetes..."
docker build -t dev/membership:dev $(PROJECT_DIR)membership -f $(PROJECT_DIR)membership/Dockerfile
kind load docker-image dev/membership:dev
kubectl apply -f $(PROJECT_DIR)membership/deployment/
kubectl rollout restart deployment membership