File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -103,5 +103,15 @@ generate-njs-yaml: ## Generate the njs-modules ConfigMap
103
103
lint-helm : # # Run the helm chart linter
104
104
helm lint $(CHART_DIR )
105
105
106
+ debug-build : # # Build binary with debug info, symbols, and no optimizations
107
+ ifeq (${TARGET},local)
108
+ @go version || (code=$$?; printf "\033[0;31mError\033[0m: unable to build locally\n"; exit $$code)
109
+ CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -trimpath -a -gcflags "all=-N -l" -ldflags "-X main.version=${VERSION} -X main.commit=${GIT_COMMIT} -X main.date=${DATE}" -o $(OUT_DIR)/gateway github.com/nginxinc/nginx-kubernetes-gateway/cmd/gateway
110
+ endif
111
+
112
+ debug-container : debug-build # # Build container with debug binary
113
+ @docker -v || (code=$$ ? ; printf " \033[0;31mError\033[0m: there was a problem with Docker\n" ; exit $$ code)
114
+ docker build --platform linux/$(ARCH ) $(strip $(DOCKER_BUILD_OPTIONS ) ) --target $(strip $(TARGET ) ) -f build/Dockerfile -t $(strip $(PREFIX ) ) :$(strip $(TAG ) ) .
115
+
106
116
.PHONY : dev-all
107
117
dev-all : deps fmt njs-fmt vet lint unit-test njs-unit-test # # Run all the development checks
You can’t perform that action at this time.
0 commit comments