-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (43 loc) · 1.22 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
# Variables
REGISTRY_NAME=malice
TAG=latest
APPS=app src cdp
HELM_RELEASE_NAME=malice-release
HELM_CHART_PATH=./helm # Update this to the path of your Helm chart
# Default target
.PHONY: all
all: build push
# Build the Docker image
.PHONY: build
build:
@for app in $(APPS); do \
docker build -t $$app -f $$app/Dockerfile $$app; \
done
# Tag the image with the registry URL
.PHONY: tag
tag:
@for app in $(APPS); do \
docker tag $$app registry.digitalocean.com/$(REGISTRY_NAME)/$$app:$(TAG); \
done
# Push the image to the registry
.PHONY: push
push: tag
@for app in $(APPS); do \
docker push registry.digitalocean.com/$(REGISTRY_NAME)/$$app:$(TAG); \
done
# Clean up local images
.PHONY: clean
clean:
@for app in $(APPS); do \
docker rmi $$app registry.digitalocean.com/$(REGISTRY_NAME)/$$app:$(TAG) || true; \
done
# Deploy with Helm
.PHONY: deploy
deploy:
@helm upgrade --install $(HELM_RELEASE_NAME) $(HELM_CHART_PATH) \
--set image.repository=registry.digitalocean.com/$(REGISTRY_NAME)/app \
--set image.tag=$(TAG) \
--set image.repository=registry.digitalocean.com/$(REGISTRY_NAME)/flask-app \
--set image.tag=$(TAG) \
--set image.repository=registry.digitalocean.com/$(REGISTRY_NAME)/cdp \
--set image.tag=$(TAG)