forked from shipwright-io/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (52 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
52
53
54
55
56
57
58
59
60
61
62
63
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/build-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
# 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:
GO111MODULE=on ginkgo \
-randomizeAllSpecs \
-randomizeSuites \
-failOnPending \
-nodes=4 \
-compilers=2 \
-slowSpecThreshold=240 \
-race \
-cover \
-trace \
internal/... \
pkg/...
local:
-hack/crd.sh uninstall
@hack/crd.sh install
operator-sdk run --local --operator-flags="$(ZAP_ENCODER_FLAG)"
clean:
rm -rf $(OUTPUT_DIR)
gen-fakes:
./hack/generate-fakes.sh
travis:
./hack/install-operator-sdk.sh
./hack/install-kind.sh
./hack/install-tekton.sh