@@ -49,19 +49,22 @@ clean: ## Cleanup build artifacts and tool binaries.
49
49
50
50
# #@ Build
51
51
52
- .PHONY : build
53
- build : build/operator-sdk build/ansible-operator build/helm-operator # # Build operator-sdk, ansible-operator, and helm-operator.
54
-
55
52
.PHONY : install
56
- GOBIN ?= $(shell go env GOPATH) /bin
57
- install : # # Install operator-sdk, ansible-operator, and helm-operator in $GOBIN
53
+ install : # # Install operator-sdk, ansible-operator, and helm-operator.
58
54
go install $(GO_BUILD_ARGS ) ./cmd/{operator-sdk,ansible-operator,helm-operator}
59
55
60
- # Build operator-sdk project binaries
56
+ .PHONY : build
57
+ build : # # Build operator-sdk, ansible-operator, and helm-operator.
58
+ @mkdir -p $(BUILD_DIR )
59
+ go build $(GO_BUILD_ARGS ) -o $(BUILD_DIR ) ./cmd/{operator-sdk,ansible-operator,helm-operator}
60
+
61
+ # Build scorecard binaries.
62
+ .PHONY : build/scorecard-test build/scorecard-test-kuttl build/custom-scorecard-tests
61
63
build/scorecard-test build/scorecard-test-kuttl build/custom-scorecard-tests :
62
- go build $(GO_GCFLAGS ) $(GO_ASMFLAGS ) -o $@ ./images/$(@F )
63
- build/% :
64
- go build $(GO_BUILD_ARGS ) -o $@ ./cmd/$*
64
+ go build $(GO_GCFLAGS ) $(GO_ASMFLAGS ) -o $(BUILD_DIR ) /$(@F ) ./images/$(@F )
65
+ .PHONY : build/operator-sdk build/ansible-operator build/helm-operator
66
+ build/operator-sdk build/ansible-operator build/helm-operator :
67
+ go build $(GO_BUILD_ARGS ) -o $(BUILD_DIR ) /$(@F ) ./cmd/$(@F )
65
68
66
69
# #@ Dev images
67
70
@@ -73,7 +76,7 @@ image-build: $(foreach i,$(IMAGE_TARGET_LIST),image/$(i)) ## Build all images.
73
76
# Build an image.
74
77
IMAGE_REPO ?= quay.io/operator-framework
75
78
image/% : build/%
76
- rm -rf build/_image && mkdir -p build/_image && mv build/$* build/_image
79
+ rm -rf build/_image && mkdir -p build/_image && cp build/$* build/_image
77
80
docker build -t $(IMAGE_REPO ) /$* :dev -f ./images/$* /Dockerfile build/_image
78
81
79
82
# #@ Test
@@ -115,9 +118,7 @@ test-e2e-setup: build
115
118
$(SCRIPTS_DIR ) /fetch kind 0.9.0
116
119
$(SCRIPTS_DIR ) /fetch envtest 0.6.3
117
120
$(SCRIPTS_DIR ) /fetch kubectl $(K8S_VERSION ) # Install kubectl AFTER envtest because envtest includes its own kubectl binary
118
- ifeq (,$(findstring $(KIND_CLUSTER ) ,$(shell $(TOOLS_DIR ) /kind get clusters -q) ) )
119
- $(TOOLS_DIR)/kind create cluster --image="kindest/node:v$(K8S_VERSION)" --name $(KIND_CLUSTER)
120
- endif
121
+ [[ " ` $( TOOLS_DIR) /kind get clusters` " =~ " $( KIND_CLUSTER) " ]] || $(TOOLS_DIR ) /kind create cluster --image=" kindest/node:v$( K8S_VERSION) " --name $(KIND_CLUSTER )
121
122
122
123
.PHONY : test-e2e-teardown
123
124
test-e2e-teardown :
@@ -126,7 +127,7 @@ test-e2e-teardown:
126
127
rm -f $(KUBECONFIG )
127
128
128
129
# Double colon rules allow repeated rule declarations.
129
- # Repeated rules are exectured in the order they appear.
130
+ # Repeated rules are executed in the order they appear.
130
131
$(e2e_targets ) :: test-e2e-setup image/scorecard-test
131
132
132
133
test-e2e :: $(e2e_tests ) # # Run e2e tests
0 commit comments