diff --git a/Makefile b/Makefile index 966f7a2b8..bcd98dd7f 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,7 @@ build: ## Build agent executable GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} ${GOBUILD} -pgo=auto -ldflags=${LDFLAGS} -o ./build/nginx-agent deps: ## Update dependencies in vendor folders + cd sdk && make generate for dir in ${VENDOR_LOCATIONS}; do \ (cd "$$dir" && echo "Running vendor commands on $$dir" && go mod tidy && GOWORK=off go mod vendor && cd "$$OLDPWD" || exit) \ done @@ -129,7 +130,7 @@ lint: ## Run linter cd sdk && make lint format: ## Format code - GOWORK=off $(GORUN) ${GOFUMPT} -l -w . + $(GORUN) ${GOFUMPT} -l -w . buf format -w ./sdk/proto/ generate-swagger: ## Generates swagger.json from source code diff --git a/Makefile.tools b/Makefile.tools index cfa4c6809..f5ef82416 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -1,3 +1,5 @@ +#!/usr/bin/make -f + BUF = "github.com/bufbuild/buf/cmd/buf@v1.29.0" OAPI_CODEGEN = "github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@v2.0.0" LEFTHOOK = "github.com/evilmartians/lefthook@v1.5.5" @@ -31,4 +33,5 @@ install-tools: ## Install tool dependencies @$(GOGET) $(MOCKGEN) @$(GOINST) $(GOFUMPT) @$(GOGET) $(COUNTERFEITER) + @echo "Setting up git hooks" @$(GORUN) $(LEFTHOOK) install pre-push diff --git a/sdk/Makefile b/sdk/Makefile index d47379b42..5a88d94ab 100644 --- a/sdk/Makefile +++ b/sdk/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests diff --git a/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile b/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile index d47379b42..5a88d94ab 100644 --- a/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile +++ b/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile b/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile index d47379b42..5a88d94ab 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests diff --git a/vendor/github.com/nginx/agent/sdk/v2/Makefile b/vendor/github.com/nginx/agent/sdk/v2/Makefile index d47379b42..5a88d94ab 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/Makefile +++ b/vendor/github.com/nginx/agent/sdk/v2/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests