Skip to content

Commit 6c72670

Browse files
committed
update Makefiles as per suggested, remove image wrapper scripts
1 parent 9030482 commit 6c72670

File tree

10 files changed

+15
-185
lines changed

10 files changed

+15
-185
lines changed

Makefile

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,22 @@ clean: ## Cleanup build artifacts and tool binaries.
4949

5050
##@ Build
5151

52-
.PHONY: build
53-
build: build/operator-sdk build/ansible-operator build/helm-operator ## Build operator-sdk, ansible-operator, and helm-operator.
54-
5552
.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.
5854
go install $(GO_BUILD_ARGS) ./cmd/{operator-sdk,ansible-operator,helm-operator}
5955

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
6163
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)
6568

6669
##@ Dev images
6770

@@ -73,7 +76,7 @@ image-build: $(foreach i,$(IMAGE_TARGET_LIST),image/$(i)) ## Build all images.
7376
# Build an image.
7477
IMAGE_REPO ?= quay.io/operator-framework
7578
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
7780
docker build -t $(IMAGE_REPO)/$*:dev -f ./images/$*/Dockerfile build/_image
7881

7982
##@ Test
@@ -115,9 +118,7 @@ test-e2e-setup: build
115118
$(SCRIPTS_DIR)/fetch kind 0.9.0
116119
$(SCRIPTS_DIR)/fetch envtest 0.6.3
117120
$(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)
121122

122123
.PHONY: test-e2e-teardown
123124
test-e2e-teardown:
@@ -126,7 +127,7 @@ test-e2e-teardown:
126127
rm -f $(KUBECONFIG)
127128

128129
# 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.
130131
$(e2e_targets):: test-e2e-setup image/scorecard-test
131132

132133
test-e2e:: $(e2e_tests) ## Run e2e tests

hack/image/ansible/Dockerfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

hack/image/build-ansible-image.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

hack/image/build-custom-scorecard-tests-image.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

hack/image/build-helm-image.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

hack/image/build-scorecard-test-image.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

hack/image/build-scorecard-test-kuttl-image.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

hack/image/build-sdk-image.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

images/operator-sdk/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
22

3-
ENV CGO_ENABLED=0
4-
53
RUN microdnf install -y golang make which
64

75
ARG BIN=operator-sdk

release/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
SHELL = /bin/bash
33
.SHELLFLAGS = -O extglob -c
44

5-
GIT_VERSION = $(shell git describe --dirty --always --tags)
65
ifneq ($(DRY_RUN),)
7-
SNAPSHOT_FLAGS = --snapshot --skip-publish --rm-dist
86
TAG ?= $(GIT_VERSION)
97
endif
108

0 commit comments

Comments
 (0)