forked from shipwright-io/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (41 loc) · 1.13 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
SHELL := /bin/bash
# output directory, where all artifacts will be created and managed
OUTPUT_DIR ?= build/_output
# relative path to operator binary
OPERATOR = $(OUTPUT_DIR)/bin/operator
# golang cache directory path
GOCACHE ?= $(shell echo ${PWD})/$(OUTPUT_DIR)/gocache
# golang target architecture
GOARCH ?= amd64
# golang global flags
GO_FLAGS ?= -v -mod=vendor
# golang test floags
GO_TEST_FLAGS ?= -failfast
# configure zap based logr
ZAP_ENCODER_FLAG = --zap-level=debug --zap-encoder=console
# CI: tekton pipelines operator version
TEKTON_VERSION ?= v0.10.1
# CI: operator-sdk version
SDK_VERSION ?= v0.15.2
.EXPORT_ALL_VARIABLES:
default: build
.PHONY: vendor
vendor: go.mod go.sum
go mod vendor
.PHONY: build
build: $(OPERATOR)
$(OPERATOR): vendor
go build $(GO_FLAGS) -o $(OPERATOR) cmd/manager/main.go
.PHONY: test
test:
go test $(GO_FLAGS) $(GO_TEST_FLAGS) ./pkg/apis/... ./pkg/controller/...
local:
-hack/crd.sh uninstall
@hack/crd.sh install
operator-sdk run --local --operator-flags="$(ZAP_ENCODER_FLAG)"
clean:
rm -rf $(OUTPUT_DIR)
travis:
./hack/install-operator-sdk.sh
./hack/install-kind.sh
./hack/install-tekton.sh