Skip to content

Commit b1bd262

Browse files
BOT: run 'make upgrade-klone' and 'make generate'
Signed-off-by: cert-manager-bot <cert-manager-bot@users.noreply.github.com>
1 parent d44f654 commit b1bd262

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

klone.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@ targets:
1010
- folder_name: boilerplate
1111
repo_url: https://github.com/cert-manager/makefile-modules.git
1212
repo_ref: main
13-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
13+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
1414
repo_path: modules/boilerplate
1515
- folder_name: generate-verify
1616
repo_url: https://github.com/cert-manager/makefile-modules.git
1717
repo_ref: main
18-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
18+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
1919
repo_path: modules/generate-verify
2020
- folder_name: go
2121
repo_url: https://github.com/cert-manager/makefile-modules.git
2222
repo_ref: main
23-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
23+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
2424
repo_path: modules/go
2525
- folder_name: help
2626
repo_url: https://github.com/cert-manager/makefile-modules.git
2727
repo_ref: main
28-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
28+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
2929
repo_path: modules/help
3030
- folder_name: klone
3131
repo_url: https://github.com/cert-manager/makefile-modules.git
3232
repo_ref: main
33-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
33+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
3434
repo_path: modules/klone
3535
- folder_name: repository-base
3636
repo_url: https://github.com/cert-manager/makefile-modules.git
3737
repo_ref: main
38-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
38+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
3939
repo_path: modules/repository-base
4040
- folder_name: tools
4141
repo_url: https://github.com/cert-manager/makefile-modules.git
4242
repo_ref: main
43-
repo_hash: adb1dd2ffdb07aae9aea40c201633c7ae59714d8
43+
repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438
4444
repo_path: modules/tools

make/_shared/go/01_mod.mk

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,41 @@ endif
2323
go_base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/
2424
golangci_lint_override := $(dir $(lastword $(MAKEFILE_LIST)))/.golangci.override.yaml
2525

26+
.PHONY: go-workspace
27+
go-workspace: export GOWORK?=$(abspath go.work)
28+
## Create a go.work file in the repository root (or GOWORK)
29+
##
30+
## @category Development
31+
go-workspace: | $(NEEDS_GO)
32+
@rm -f $(GOWORK)
33+
$(GO) work init
34+
@find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \
35+
| while read d; do \
36+
target=$$(dirname $${d}); \
37+
$(GO) work use "$${target}"; \
38+
done
39+
40+
.PHONY: go-tidy
41+
## Alias for `make generate-go-mod-tidy`
42+
## @category [shared] Generate/ Verify
43+
go-tidy: generate-go-mod-tidy
44+
45+
.PHONY: generate-go-mod-tidy
46+
## Run `go mod tidy` on all Go modules
47+
## @category [shared] Generate/ Verify
48+
generate-go-mod-tidy: | $(NEEDS_GO)
49+
@find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \
50+
| while read d; do \
51+
target=$$(dirname $${d}); \
52+
echo "Running 'go mod tidy' in directory '$${target}'"; \
53+
pushd "$${target}" >/dev/null; \
54+
$(GO) mod tidy || exit; \
55+
popd >/dev/null; \
56+
echo ""; \
57+
done
58+
59+
shared_generate_targets += generate-go-mod-tidy
60+
2661
.PHONY: generate-govulncheck
2762
## Generate base files in the repository
2863
## @category [shared] Generate/ Verify

0 commit comments

Comments
 (0)