forked from openshift/tektoncd-pipeline-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (66 loc) · 1.85 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
export GO111MODULE:=on
export GOCACHE=/tmp/.cache/go-build
include ./make/verbose.mk
.DEFAULT_GOAL := help
include ./make/help.mk
include ./make/out.mk
include ./make/find-tools.mk
include ./make/go.mk
include ./make/git.mk
include ./make/dev.mk
include ./make/format.mk
include ./make/lint.mk
include ./make/test.mk
include ./make/docker.mk
include ./make/csv.mk
include ./opo-makefile.mk
BUILD_OUTPUT_DIR ?= ./out/
BUILD_OUTPUT_FILE ?= operator
VENDOR_BUILD ?=
.PHONY: build
## Build the operator
build: ./out/operator
.PHONY: build-all
## Build the operator and compress all manifests
build-all: ./out/operator ./out/build/bin manifests
.PHONY: clean
clean:
$(Q)-rm -rf ${V_FLAG} ./out
$(Q)-rm -rf ${V_FLAG} ./vendor
$(Q)-rm -rf ${V_FLAG} ./tmp
$(Q)go clean ${X_FLAG} ./...
.PHONY: ./vendor
./vendor: go.mod go.sum
$(Q)go mod vendor
ifeq ($(shell uname -m),x86_64)
ARCH := amd64
else ifeq ($(shell uname -m),ppc64le)
ARCH := ppc64le
endif
./out/operator: ./vendor $(shell find . -path ./vendor -prune -o -name '*.go' -print)
#$(Q)operator-sdk generate k8s
$(Q)go version
$(Q)CGO_ENABLED=0 GOARCH=${ARCH} GOOS=linux \
go build ${V_FLAG} ${VENDOR_BUILD} -o ${BUILD_OUTPUT_DIR}${BUILD_OUTPUT_FILE} \
./cmd/manager
./out/build/bin:
$(Q)mkdir -p ./out/build
$(Q)cp -r build/bin ./out/build/bin
manifests:
$(Q)cp -r deploy/olm-catalog manifests && \
tar -zcf manifests.tar.gz manifests && \
rm -rf manifests
# TODO: Disable for now for CI to go over
upgrade-build: #TODO: reenable it
.PHONY: osdk-image
osdk-image:
ifeq ($(uname -m),x86_64)
ARCH=amd64
else ifeq ($(uname -m),ppc64le)
ARCH=ppc64le
endif
$(Q)rm -rf build/_output/bin
$(eval IMAGE_TAG := quay.io/rhpipeline/openshift-pipelines-operator:test)
$(Q) GOARCH=${ARCH} operator-sdk build \
--go-build-args "-o build/_output/bin/openshift-pipelines-operator" \
$(IMAGE_TAG)