Skip to content

Commit baae248

Browse files
authored
Merge pull request #5 from inteon/upgrade_oci_module
Upgrade oci module
2 parents 6be6e1e + f1478a2 commit baae248

File tree

5 files changed

+43
-15
lines changed

5 files changed

+43
-15
lines changed

klone.yaml

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

make/00_mod.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ repo_name := github.com/cert-manager/cmctl/v2
1717
exe_build_names := cmctl kubectl_cert-manager
1818
gorelease_file := .goreleaser.yml
1919

20-
go_cmctl_source_path := main.go
20+
go_cmctl_main_dir := .
21+
go_cmctl_mod_dir := .
2122
go_cmctl_ldflags := \
2223
-X $(repo_name)/pkg/build.name=cmctl \
2324
-X $(repo_name)/pkg/build/commands.registerCompletion=true \
2425
-X github.com/cert-manager/cert-manager/pkg/util.AppVersion=$(VERSION) \
2526
-X github.com/cert-manager/cert-manager/pkg/util.AppGitCommit=$(GITCOMMIT)
2627

27-
go_kubectl_cert-manager_source_path := main.go
28+
go_kubectl_cert-manager_main_dir := .
29+
go_kubectl_cert-manager_mod_dir := .
2830
go_kubectl_cert-manager_ldflags := \
2931
-X $(repo_name)/pkg/build.name=kubectl \
3032
-X $(repo_name)/pkg/build/commands.registerCompletion=false \

make/02_mod.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ dryrun-release: release
2525
## Publish all release artifacts (image + helm chart)
2626
## @category [shared] Release
2727
release: | $(NEEDS_CRANE) $(bin_dir)/scratch
28-
$(MAKE) oci-push-cmctl
2928
$(MAKE) exe-publish
3029

3130
@echo "Release complete!"

make/_shared/executable/01_mod.mk

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ifndef build_names
2222
ifndef exe_build_names
2323
$(error build_names and exe_build_names are not set)
2424
endif
25+
build_names := # empty
2526
endif
2627

2728
all_exe_build_names := $(sort $(build_names) $(exe_build_names))
@@ -30,7 +31,28 @@ fatal_if_undefined = $(if $(findstring undefined,$(origin $1)),$(error $1 is not
3031

3132
define check_variables
3233
$(call fatal_if_undefined,go_$1_ldflags)
33-
$(call fatal_if_undefined,go_$1_source_path)
34+
$(call fatal_if_undefined,go_$1_main_dir)
35+
$(call fatal_if_undefined,go_$1_mod_dir)
36+
37+
ifneq ($(go_$1_main_dir:.%=.),.)
38+
$$(error go_$1_main_dir "$(go_$1_main_dir)" should be a directory path that DOES start with ".")
39+
endif
40+
ifeq ($(go_$1_main_dir:%/=/),/)
41+
$$(error go_$1_main_dir "$(go_$1_main_dir)" should be a directory path that DOES NOT end with "/")
42+
endif
43+
ifeq ($(go_$1_main_dir:%.go=.go),.go)
44+
$$(error go_$1_main_dir "$(go_$1_main_dir)" should be a directory path that DOES NOT end with ".go")
45+
endif
46+
ifneq ($(go_$1_mod_dir:\.%=\.),.)
47+
$$(error go_$1_mod_dir "$(go_$1_mod_dir)" should be a directory path that DOES start with ".")
48+
endif
49+
ifeq ($(go_$1_mod_dir:%/=/),/)
50+
$$(error go_$1_mod_dir "$(go_$1_mod_dir)" should be a directory path that DOES NOT end with "/")
51+
endif
52+
ifeq ($(go_$1_mod_dir:%.go=.go),.go)
53+
$$(error go_$1_mod_dir "$(go_$1_mod_dir)" should be a directory path that DOES NOT end with ".go")
54+
endif
55+
3456
endef
3557

3658
$(foreach build_name,$(all_exe_build_names),$(eval $(call check_variables,$(build_name))))
@@ -55,18 +77,21 @@ $(bin_dir)/bin:
5577
.PHONY: $(run_targets)
5678
ARGS ?= # default empty
5779
## Directly run the go source locally.
80+
## Any Go workfile is ignored.
5881
## @category [shared] Build
5982
$(run_targets): run-%: | $(NEEDS_GO)
83+
GOWORK=off \
6084
CGO_ENABLED=$(CGO_ENABLED) \
6185
GOEXPERIMENT=$(GOEXPERIMENT) \
6286
$(GO) run \
6387
-ldflags '$(go_$*_ldflags)' \
6488
$(go_$*_source_path) $(ARGS)
6589

6690
## Build the go source locally for development/ testing
67-
## on the local platform.
91+
## on the local platform. Any Go workfile is ignored.
6892
## @category [shared] Build
6993
$(build_targets): $(bin_dir)/bin/%: FORCE | $(NEEDS_GO)
94+
GOWORK=off \
7095
CGO_ENABLED=$(CGO_ENABLED) \
7196
GOEXPERIMENT=$(GOEXPERIMENT) \
7297
$(GO) build \
@@ -76,7 +101,8 @@ $(build_targets): $(bin_dir)/bin/%: FORCE | $(NEEDS_GO)
76101

77102
define template_for_target
78103
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .binary = "$(1)")' | \
79-
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .main = "$(go_$(1)_source_path)")' | \
104+
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .main = "$(go_$(1)_main_dir)")' | \
105+
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .dir = "$(go_$(1)_mod_dir)")' | \
80106
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .env[0] = "CGO_ENABLED={{.Env.CGO_ENABLED}}")' | \
81107
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .env[1] = "GOEXPERIMENT={{.Env.GOEXPERIMENT}}")' | \
82108
$(YQ) 'with(.builds[]; select(.id == "$(1)") | .mod_timestamp = "{{.Env.SOURCE_DATE_EPOCH}}")' | \
@@ -106,6 +132,7 @@ ifeq ($(RELEASE_DRYRUN),true)
106132
$(eval extra_args := $(extra_args) --skip=announce,publish,validate,sign)
107133
endif
108134

135+
GOWORK=off \
109136
SOURCE_DATE_EPOCH=$(GITEPOCH) \
110137
CGO_ENABLED=$(CGO_ENABLED) \
111138
GOEXPERIMENT=$(GOEXPERIMENT) \

make/_shared/tools/00_mod.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ GO_DEPENDENCIES += helm-tool=github.com/cert-manager/helm-tool
282282

283283
define go_dependency
284284
$$(bin_dir)/downloaded/tools/$1@$($(call UC,$1)_VERSION)_%: | $$(NEEDS_GO) $$(bin_dir)/downloaded/tools
285-
GOBIN=$$(CURDIR)/$$(dir $$@) $$(GO) install $2@$($(call UC,$1)_VERSION)
285+
GOWORK=off GOBIN=$$(CURDIR)/$$(dir $$@) $$(GO) install $2@$($(call UC,$1)_VERSION)
286286
@mv $$(CURDIR)/$$(dir $$@)/$1 $$@
287287
endef
288288

0 commit comments

Comments
 (0)