From ea193328e303adc846d69d0ca1aef14c79c55b09 Mon Sep 17 00:00:00 2001 From: Katrina Verey Date: Mon, 4 Apr 2022 19:18:25 -0400 Subject: [PATCH] Run all non plugin module builds --- Makefile | 22 +++++++++++-------- Makefile-modules.mk | 5 ++++- api/Makefile | 7 ++++++ .../commands/e2e/e2econtainerconfig/Makefile | 3 +-- cmd/depprobcheck/Makefile | 3 +++ kustomize/Makefile | 4 +--- kyaml/Makefile | 3 +++ 7 files changed, 32 insertions(+), 15 deletions(-) mode change 100644 => 120000 kustomize/Makefile diff --git a/Makefile b/Makefile index 744510014..a1756033e 100644 --- a/Makefile +++ b/Makefile @@ -84,11 +84,11 @@ kustomize: $(MYGOBIN)/kustomize # plugin-to-api compatibility checks. .PHONY: build-kustomize-api build-kustomize-api: $(builtinplugins) - cd api; go build ./... + cd api; $(MAKE) build .PHONY: generate-kustomize-api -generate-kustomize-api: $(MYGOBIN)/k8scopy - cd api; go generate ./... +generate-kustomize-api: + cd api; $(MAKE) generate # --- Verification targets --- @@ -98,6 +98,7 @@ verify-kustomize: \ lint-kustomize \ test-unit-kustomize-all \ test-unit-non-plugin \ + build-non-plugin \ test-go-mod \ test-examples-kustomize-against-HEAD \ test-examples-kustomize-against-v4-release @@ -122,9 +123,9 @@ lint: $(MYGOBIN)/golangci-lint $(MYGOBIN)/goimports $(builtinplugins) .PHONY: lint-kustomize lint-kustomize: $(MYGOBIN)/golangci-lint-kustomize $(builtinplugins) - cd api; make lint - cd kustomize; make lint - cd cmd/pluginator; make lint + cd api; $(MAKE) lint + cd kustomize; $(MAKE) lint + cd cmd/pluginator; $(MAKE) lint .PHONY: test-unit-all test-unit-all: $(builtinplugins) @@ -134,10 +135,13 @@ test-unit-all: $(builtinplugins) test-unit-non-plugin: ./hack/for-each-module.sh "make test" "./plugin/*" 15 +.PHONY: build-non-plugin +build-non-plugin: + ./hack/for-each-module.sh "make build" "./plugin/*" 15 + .PHONY: test-unit-kustomize-api test-unit-kustomize-api: build-kustomize-api - cd api; go test ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222" - cd api/krusty; OPENAPI_TEST=true go test -run TestCustomOpenAPIFieldFromComponentWithOverlays + cd api; $(MAKE) test .PHONY: test-unit-kustomize-plugins test-unit-kustomize-plugins: @@ -145,7 +149,7 @@ test-unit-kustomize-plugins: .PHONY: test-unit-kustomize-cli test-unit-kustomize-cli: - cd kustomize; go test ./... + cd kustomize; $(MAKE) test .PHONY: test-unit-kustomize-all test-unit-kustomize-all: \ diff --git a/Makefile-modules.mk b/Makefile-modules.mk index 8eda2efc4..894f5eee0 100644 --- a/Makefile-modules.mk +++ b/Makefile-modules.mk @@ -11,7 +11,7 @@ export PATH := $(MYGOBIN):$(PATH) export KUSTOMIZE_ROOT ?= $(shell pwd | sed -E 's|(.*\/kustomize)/(.*)|\1|') include $(KUSTOMIZE_ROOT)/Makefile-tools.mk -.PHONY: lint test fix fmt tidy vet +.PHONY: lint test fix fmt tidy vet build lint: $(MYGOBIN)/golangci-lint $(MYGOBIN)/golangci-lint \ @@ -33,3 +33,6 @@ tidy: vet: go vet ./... + +build: + go build -v ./... diff --git a/api/Makefile b/api/Makefile index 05a1c2d83..7fe870f52 100644 --- a/api/Makefile +++ b/api/Makefile @@ -5,3 +5,10 @@ include ../Makefile-modules.mk test: go test -v -timeout 45m -cover ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222" + cd api/krusty; OPENAPI_TEST=true go test -run TestCustomOpenAPIFieldFromComponentWithOverlays + +build: + go build -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222" ./... + +generate: $(MYGOBIN)/k8scopy $(MYGOBIN)/stringer + go generate ./... diff --git a/cmd/config/internal/commands/e2e/e2econtainerconfig/Makefile b/cmd/config/internal/commands/e2e/e2econtainerconfig/Makefile index 08ba0ff68..97343c15f 100644 --- a/cmd/config/internal/commands/e2e/e2econtainerconfig/Makefile +++ b/cmd/config/internal/commands/e2e/e2econtainerconfig/Makefile @@ -1,10 +1,9 @@ # Copyright 2019 The Kubernetes Authors. # SPDX-License-Identifier: Apache-2.0 -.PHONY: generate fix vet fmt test build tidy - include ../../../../../../Makefile-modules.mk +.PHONY: image image: docker build . -t gcr.io/kustomize-functions/e2econtainerconfig docker push gcr.io/kustomize-functions/e2econtainerconfig diff --git a/cmd/depprobcheck/Makefile b/cmd/depprobcheck/Makefile index 994e797e3..66948c20f 100644 --- a/cmd/depprobcheck/Makefile +++ b/cmd/depprobcheck/Makefile @@ -8,3 +8,6 @@ lint: test: echo "Skipping test for broken module depprobcheck" + +build: + echo "Skipping build for broken module depprobcheck" diff --git a/kustomize/Makefile b/kustomize/Makefile deleted file mode 100644 index 266eb4a6f..000000000 --- a/kustomize/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -export KUSTOMIZE_ROOT=$(shell cd .. && pwd) - -include ../Makefile-modules.mk diff --git a/kustomize/Makefile b/kustomize/Makefile new file mode 120000 index 000000000..d2f92ca51 --- /dev/null +++ b/kustomize/Makefile @@ -0,0 +1 @@ +../Makefile-modules.mk \ No newline at end of file diff --git a/kyaml/Makefile b/kyaml/Makefile index ce00ca808..acf21808c 100644 --- a/kyaml/Makefile +++ b/kyaml/Makefile @@ -46,3 +46,6 @@ tidy: vet: go vet $(shell go list ./... | grep -v "/kyaml/internal/forked/github.com/go-yaml/yaml") + +build: + go build -v ./...