Skip to content

Commit e012f97

Browse files
committed
use existing install tooling to install cyclonedx-gomod as requested by @Gerrit91
1 parent 5442d11 commit e012f97

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ release-manifests: generate-sbom $(KUSTOMIZE) build-installer ## Builds the mani
5757
cp sbom.json $(RELEASE_DIR)/sbom.json
5858

5959
.PHONY: generate-sbom
60-
generate-sbom:
61-
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
62-
cyclonedx-gomod mod -licenses -test -type library -json -output sbom.json .
60+
generate-sbom: cyclonedx
61+
$(CYCLONE_DX) mod -licenses -test -type library -json -output sbom.json .
6362

6463
##@ Development
6564

@@ -201,18 +200,25 @@ $(LOCALBIN):
201200
mkdir -p $(LOCALBIN)
202201

203202
## Tool Binaries
203+
CYCLONE_DX ?= $(LOCALBIN)/cyclonedx-gomod
204204
KUBECTL ?= kubectl
205205
KUSTOMIZE ?= $(LOCALBIN)/kustomize
206206
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
207207
ENVTEST ?= $(LOCALBIN)/setup-envtest
208208
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
209209

210210
## Tool Versions
211+
CYCLONE_DX_VERSION ?= v1.9.0
211212
KUSTOMIZE_VERSION ?= v5.4.3
212213
CONTROLLER_TOOLS_VERSION ?= v0.16.4
213214
ENVTEST_VERSION ?= release-0.19
214215
GOLANGCI_LINT_VERSION ?= v1.61.0
215216

217+
.PHONY: cyclonedx
218+
cyclonedx: $(CYCLONE_DX) ## Download cyclonedx-gomod locally if necessary.
219+
$(CYCLONE_DX): $(LOCALBIN)
220+
$(call go-install-tool,$(CYCLONE_DX),github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod,$(CYCLONE_DX_VERSION))
221+
216222
.PHONY: kustomize
217223
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
218224
$(KUSTOMIZE): $(LOCALBIN)

0 commit comments

Comments
 (0)