-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1.26 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
APP_NAME ?= route-to-ingress
VERSION ?= 0.3.2
IMAGE_HOST ?= ghcr.io
IMAGE_NAME ?= getupcloud/$(APP_NAME)
IMAGE := $(IMAGE_HOST)/$(IMAGE_NAME)
CLUSTER_ISSUER ?= letsencrypt-staging-http01
DRY_RUN ?= false
INGRESS_CLASS_NAME ?= $(APP_NAME)
NAMESPACES ?= getup
.ONESHELL:
.EXPORT_ALL_VARIABLES:
SHELL = /bin/bash
all: build help
help:
@echo Targets:
@echo ' build: Create docker image.'
@echo ' run: Run dev.'
@echo ' push: Push image to repo $(IMAGE).'
@echo ' release: Build and push.'
KUBECONFIG ?= ~/.kube/config
run:
docker run -it --rm --name $(APP_NAME) \
-v $(PWD):/app \
-v $(wildcard $(KUBECONFIG)):/app/kubeconfig \
-e CLUSTER_ISSUER=$(CLUSTER_ISSUER) \
-e DRY_RUN=$(DRY_RUN) \
-e INGRESS_CLASS_NAME=$(INGRESS_CLASS_NAME) \
-e IGNORE_DANGEROUS_INGRESS_CLASS_NAME=$(IGNORE_DANGEROUS_INGRESS_CLASS_NAME) \
-e KUBECONFIG=/app/kubeconfig \
-e NAMESPACES=$(NAMESPACES) \
$(IMAGE):$(VERSION)
build b:
docker build . -t $(IMAGE):$(VERSION)
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest
push p:
docker push $(IMAGE):$(VERSION)
docker push $(IMAGE):latest
.PHONY: manifests
manifests:
sed -i -e 's|image: $(IMAGE):.*|image: $(IMAGE):$(VERSION)|' manifests/deployment.yaml
release r: manifests build push