-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
62 lines (47 loc) · 1.6 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
56
57
58
59
60
61
62
# MAKEFILE FOR LOCAL DEVELOPMENT
SHELL := /bin/bash
SLEEP=$(shell which sleep)
CURL=$(shell which curl)
DOCKER=$(shell which docker)
MINIKUBE=$(shell which minikube)
KUBECTL=$(shell which kubectl)
# KUBECONFIG ?= $(HOME)/.kube/config
###### TEST FOR TEKTON PIPELINE #######
expanded = "$(simple)"
simple := "foo"
clean:
rm bar
rm foo
foo: bar
touch foo
bar:
touch bar
all: foo
test:
@echo lolnah
.PHONY: all clean test
.DEFAULT_GOAL: all
#######################################
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
## LOCAL DOCKER REGISTRY
docker-registry-up: ## Spin up a local docker registry
@$(DOCKER) run -d -p 5000:5000 --restart=always --name registry registry:2
@$(SLEEP) 2
@$(CURL) -X GET http://localhost:5000/v2/_catalog
docker-registry-down: ## Delete the local docker registry
@$(DOCKER) container stop registry
@$(DOCKER) container rm -v registry
## MINIKUBE
mini-up: ## Spin up a dev cluster with Minikube
@$(MINIKUBE) start --profile dev-cluster
@$(KUBECTL) get ns
mini-dashboard: ## Enable minikube web dashboard
@$(MINIKUBE) dashboard --url
mini-down: ## Delete the Minikube dev cluster
@$(MINIKUBE) stop --profile dev-cluster
@$(MINIKUBE) delete --profile dev-cluster
docker-pull-and-run-from-local: ## Pull the image from local registry and runs it
@$(DOCKER) pull localhost:5000/app:v1
@$(DOCKER) run -it --rm -p 8887:8887 localhost:5000/app:v1