-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (41 loc) · 1.76 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
.PHONY: build help generate test lint fmt dependencies clean check coverage service race .remove_empty_dirs .pre-check-go
SRCS = $(patsubst ./%,%,$(shell find . -name "*.go" -not -path "*vendor*" -not -path "*.pb.go"))
DOCKER_REPOSITORY = "mvatandoost"
PROJECT_NAME = "xds-control-plane"
TAG = "latest"
HELM_REPO_ADDRESS = "https://mohammadVatandoost.github.io/helm-chart/"
HELM_REPO_NAME = "myhelmrepo"
VERSION = "dev"
NAMESPACE = "test"
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
CONTROL_PLANE_DIR ?= .
TOOLS_DIR = $(CONTROL_PLANE_DIR)/tools
# Important to use `:=` to only run the script once per make invocation!
BUILD_INFO := $(shell $(TOOLS_DIR)/releases/version.sh)
BUILD_INFO_VERSION = $(word 1, $(BUILD_INFO))
# build: $(SRCS)
# go build -o ./build/$(PROJECT_NAME) -ldflags="$(LD_FLAGS)" ./cmd/...
fmt: ## to run `go fmt` on all source code
gofmt -s -w $(SRCS)
kind-load:
kind load docker-image $(DOCKER_REPOSITORY)/$(PROJECT_NAME):$(TAG)
helm-lint:
helm lint deployments/helm/$(PROJECT_NAME)
helm-package:
helm repo add $(HELM_REPO_NAME) $(HELM_REPO_ADDRESS)
helm dependency update ./deployments/helm/$(PROJECT_NAME)
helm package --app-version=$(VERSION) ./deployments/helm/$(PROJECT_NAME)
helm-deploy:
helm -n $(NAMESPACE) upgrade -i $(PROJECT_NAME) -f ./deployments/helm/$(PROJECT_NAME)/values.yaml *.tgz
helm-ci-cd:
helm lint deployments/helm/$(PROJECT_NAME)
helm repo add $(HELM_REPO_NAME) $(HELM_REPO_ADDRESS)
helm dependency update ./deployments/helm/$(PROJECT_NAME)
helm package --app-version=$(VERSION) ./deployments/helm/$(PROJECT_NAME)
helm -n $(NAMESPACE) upgrade -i $(PROJECT_NAME) -f ./deployments/helm/$(PROJECT_NAME)/values.yaml *.tgz
include mk/dev.mk
include mk/build.mk
include mk/docker.mk
include mk/kind.mk
include mk/microk8s.mk