File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -38,20 +38,25 @@ help: ## Display this help
38
38
39
39
# #@ Build
40
40
41
+ LD_FLAGS =-ldflags " \
42
+ -X sigs.k8s.io/kubebuilder/v2/cmd.kubeBuilderVersion=$(shell git descripe --tags --dirty --broken) \
43
+ -X sigs.k8s.io/kubebuilder/v2/cmd.goos=$(shell go env GOOS) \
44
+ -X sigs.k8s.io/kubebuilder/v2/cmd.goarch=$(shell go env GOARCH) \
45
+ -X sigs.k8s.io/kubebuilder/v2/cmd.gitCommit=$(shell git rev-parse HEAD) \
46
+ -X sigs.k8s.io/kubebuilder/v2/cmd.buildDate=$(shell date -u +'% Y-% m-% dT% H:% M:% SZ') \
47
+ "
41
48
.PHONY : build
42
49
build : # # Build the project locally
43
- go build -o bin/kubebuilder ./cmd
50
+ go build $( LD_FLAGS ) -o bin/kubebuilder ./cmd
44
51
45
52
.PHONY : install
46
- install : # # Build and install the binary with the current source code. Use it to test your changes locally.
47
- make build
53
+ install : build # # Build and install the binary with the current source code. Use it to test your changes locally.
48
54
cp ./bin/kubebuilder $(GOBIN ) /kubebuilder
49
55
50
56
# #@ Development
51
57
52
58
.PHONY : generate
53
- generate : # # Update/generate all mock data. You should run this commands to update the mock data after your changes.
54
- make generate-testdata
59
+ generate : generate-testdata # # Update/generate all mock data. You should run this commands to update the mock data after your changes.
55
60
go mod tidy
56
61
57
62
.PHONY : generate-testdata
You can’t perform that action at this time.
0 commit comments