Skip to content

Commit 1c6b569

Browse files
timflannagananik120
authored andcommitted
Makefile,scripts: Refactor tool dependencies (#1001)
Signed-off-by: timflannagan <[email protected]>
1 parent 6f9063f commit 1c6b569

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

staging/operator-registry/Makefile

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ clean:
115115
@rm -rf ./bin
116116

117117
.PHONY: e2e
118-
e2e:
119-
$(GO) run github.com/onsi/ginkgo/v2/ginkgo --v --randomize-all --progress --trace --randomize-suites --race $(if $(TEST),-focus '$(TEST)') $(TAGS) ./test/e2e -- $(if $(SKIPTLS),-skip-tls-verify true) $(if $(USEHTTP),-use-http true)
118+
e2e: ginkgo
119+
$(GINKGO) --v --randomize-all --progress --trace --randomize-suites --race $(if $(TEST),-focus '$(TEST)') $(TAGS) ./test/e2e -- $(if $(SKIPTLS),-skip-tls-verify true) $(if $(USEHTTP),-use-http true)
120120

121121
.PHONY: release
122122
export OPM_IMAGE_REPO ?= quay.io/operator-framework/opm
@@ -137,8 +137,8 @@ export LATEST_IMAGE_OR_EMPTY ?= $(shell \
137137
&& [ "$(shell echo -e "$(OPM_VERSION)\n$(LATEST_TAG)" | sort -rV | head -n1)" == "$(OPM_VERSION)" ] \
138138
&& echo "$(OPM_IMAGE_REPO):latest" || echo "")
139139
release: RELEASE_ARGS ?= release --rm-dist --snapshot -f release/goreleaser.$(shell go env GOOS).yaml
140-
release:
141-
./scripts/fetch goreleaser 1.4.1 && ./bin/goreleaser $(RELEASE_ARGS)
140+
release: goreleaser
141+
$(GORELEASER) $(RELEASE_ARGS)
142142

143143
# tagged-or-empty returns $(OPM_IMAGE_REPO):$(1) when HEAD is assigned a non-prerelease semver tag,
144144
# otherwise the empty string. An empty string causes goreleaser to skip building
@@ -150,3 +150,32 @@ $(shell \
150150
&& git describe --tags --exact-match HEAD >/dev/null 2>&1 \
151151
&& echo "$(OPM_IMAGE_REPO):$(1)" || echo "" )
152152
endef
153+
154+
################
155+
# Hack / Tools #
156+
################
157+
158+
GO_INSTALL_OPTS ?= "-mod=mod"
159+
160+
## Location to install dependencies to
161+
LOCALBIN ?= $(shell pwd)/bin
162+
$(LOCALBIN):
163+
mkdir -p $(LOCALBIN)
164+
165+
## Tool Binaries
166+
GORELEASER ?= $(LOCALBIN)/goreleaser
167+
GINKGO ?= $(LOCALBIN)/ginkgo
168+
169+
## Tool Versions
170+
GORELEASER_VERSION ?= v1.8.3
171+
GINKGO_VERSION ?= v2.1.3
172+
173+
.PHONY: goreleaser
174+
goreleaser: $(GORELEASER) ## Download goreleaser locally if necessary.
175+
$(GORELEASER): $(LOCALBIN)
176+
GOBIN=$(LOCALBIN) go install $(GO_INSTALL_OPTS) github.com/goreleaser/goreleaser@$(GORELEASER_VERSION)
177+
178+
.PHONY: ginkgo
179+
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
180+
$(GINKGO): $(LOCALBIN)
181+
GOBIN=$(LOCALBIN) go install $(GO_INSTALL_OPTS) github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)

staging/operator-registry/scripts/fetch

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

0 commit comments

Comments
 (0)