-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 2.05 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
################################################################################
# Variables #
################################################################################
OUT_DIR := ./dist
GIT_COMMIT = $(shell git rev-list -1 HEAD)
GIT_VERSION = $(shell git describe --always --abbrev=7 --dirty)
VERSION ?= edge
# Helm template and install setting
HELM:=helm
RELEASE_NAME?=platform-controllers
HELM_NAMESPACE?=default
HELM_CHART_ROOT:=./helm
################################################################################
# Go build details #
################################################################################
BASE_PACKAGE_NAME := totalsoft.ro/platform-controllers
DEFAULT_LDFLAGS:=-X $(BASE_PACKAGE_NAME)/internal/version.gitcommit=$(GIT_COMMIT) \
-X $(BASE_PACKAGE_NAME)/internal/version.gitversion=$(GIT_VERSION) \
-X $(BASE_PACKAGE_NAME)/internal/version.version=$(VERSION)
################################################################################
# Target: build-linux #
################################################################################
build-linux:
mkdir -p $(OUT_DIR)
CGO_ENABLED=0 GOOS=linux go build -o $(OUT_DIR) -ldflags "$(DEFAULT_LDFLAGS) -s -w" ./cmd/tenant-provisioner ./cmd/platform-controller ./cmd/configuration-domain-controller
modtidy:
go mod tidy
upgrade-all:
go get -u ./...
go mod tidy
init-proto:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
gen-proto:
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative internal/messaging/rusi/v1/rusi.proto
test:
CGO_ENABLED=0 go test -v `go list ./... | grep -v 'platform-controllers/pkg/generated'`
include hack/generate_kube_crd.mk
include docker/docker.mk
include internal/controllers/provisioning/provisioners/pulumi/fluxcd/generate_pulumi_fluxcd_apis.mk