From 2aa6862c9bff1d449ed22ef2fc8a88ba029cae57 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Tue, 19 Nov 2024 16:30:57 +0000 Subject: [PATCH 01/29] Introduce .make directory for sentinel targets Create a `.make` directory for tracking targets which don't generate a single file output. This should be ignored by git. For targets which either don't generate a single file output, or the output file is committed, we use a "sentinel" file within `.make/` to track the staleness of the target and only rebuild when needed. For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. At the end of each internal target we run `@touch $@` to update the file which is the name of the target. --- .../internal/pkg/migrations/ignoreMakeDir.go | 38 +++++++++++++++++++ .../internal/pkg/migrations/migrations.go | 1 + .../pkg/templates/bridged-provider/Makefile | 7 ++++ provider-ci/test-providers/acme/Makefile | 7 ++++ provider-ci/test-providers/aws/Makefile | 7 ++++ .../test-providers/cloudflare/Makefile | 7 ++++ provider-ci/test-providers/docker/Makefile | 7 ++++ 7 files changed, 74 insertions(+) create mode 100644 provider-ci/internal/pkg/migrations/ignoreMakeDir.go diff --git a/provider-ci/internal/pkg/migrations/ignoreMakeDir.go b/provider-ci/internal/pkg/migrations/ignoreMakeDir.go new file mode 100644 index 000000000..1415b3f50 --- /dev/null +++ b/provider-ci/internal/pkg/migrations/ignoreMakeDir.go @@ -0,0 +1,38 @@ +package migrations + +import ( + _ "embed" + "fmt" + "os" + "path/filepath" + "strings" +) + +type ignoreMakeDir struct{} + +func (ignoreMakeDir) Name() string { + return "Fixup Bridge Imports" +} +func (ignoreMakeDir) ShouldRun(templateName string) bool { + return templateName == "bridged-provider" +} +func (ignoreMakeDir) Migrate(templateName, outDir string) error { + gitignorePath := filepath.Join(outDir, ".gitignore") + gitignore, err := os.ReadFile(gitignorePath) + if err != nil { + if !os.IsNotExist(err) { + return fmt.Errorf("error reading .gitignore: %w", err) + } + gitignore = []byte{} + } + gitignoreString := string(gitignore) + if !strings.Contains(gitignoreString, ".make") { + gitignoreString += "\n\n# Ignore local build tracking directory\n.make\n" + err := os.WriteFile(gitignorePath, []byte(gitignoreString), 0644) + if err != nil { + return fmt.Errorf("error writing to .gitignore: %w", err) + } + return err + } + return nil +} diff --git a/provider-ci/internal/pkg/migrations/migrations.go b/provider-ci/internal/pkg/migrations/migrations.go index 0d278bfcc..cde90b4ee 100644 --- a/provider-ci/internal/pkg/migrations/migrations.go +++ b/provider-ci/internal/pkg/migrations/migrations.go @@ -16,6 +16,7 @@ func Migrate(templateName, outDir string) error { migrations := []Migration{ fixupBridgeImports{}, removeExplicitSDKDependency{}, + ignoreMakeDir{}, } for i, migration := range migrations { if !migration.ShouldRun(templateName) { diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 9179933d9..ed83b7a29 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -43,6 +43,13 @@ LDFLAGS_UPSTREAM_VERSION= LDFLAGS_EXTRAS=#{{- range .Config.ExtraLDFlags }}# #{{ . }}# #{{- end }}# LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $(LDFLAGS_STRIP_SYMBOLS) +# Create a `.make` directory for tracking targets which don't generate a single file output. This should be ignored by git. +# For targets which either don't generate a single file output, or the output file is committed, we use a "sentinel" +# file within `.make/` to track the staleness of the target and only rebuild when needed. +# For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. +# At the end of each internal target we run `@touch $@` to update the file which is the name of the target. +_ := $(shell mkdir -p .make) + development: install_plugins provider build_sdks install_sdks build: install_plugins provider build_sdks install_sdks diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index e16aa0723..d012cb5f6 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -27,6 +27,13 @@ LDFLAGS_UPSTREAM_VERSION= LDFLAGS_EXTRAS= LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $(LDFLAGS_STRIP_SYMBOLS) +# Create a `.make` directory for tracking targets which don't generate a single file output. This should be ignored by git. +# For targets which either don't generate a single file output, or the output file is committed, we use a "sentinel" +# file within `.make/` to track the staleness of the target and only rebuild when needed. +# For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. +# At the end of each internal target we run `@touch $@` to update the file which is the name of the target. +_ := $(shell mkdir -p .make) + development: install_plugins provider build_sdks install_sdks build: install_plugins provider build_sdks install_sdks diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 178c96d93..f09f80b78 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -27,6 +27,13 @@ LDFLAGS_UPSTREAM_VERSION=-X github.com/hashicorp/terraform-provider-aws/version. LDFLAGS_EXTRAS= LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $(LDFLAGS_STRIP_SYMBOLS) +# Create a `.make` directory for tracking targets which don't generate a single file output. This should be ignored by git. +# For targets which either don't generate a single file output, or the output file is committed, we use a "sentinel" +# file within `.make/` to track the staleness of the target and only rebuild when needed. +# For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. +# At the end of each internal target we run `@touch $@` to update the file which is the name of the target. +_ := $(shell mkdir -p .make) + development: install_plugins provider build_sdks install_sdks build: install_plugins provider build_sdks install_sdks diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index eccc64b31..fbe3c54ae 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -27,6 +27,13 @@ LDFLAGS_UPSTREAM_VERSION= LDFLAGS_EXTRAS= LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $(LDFLAGS_STRIP_SYMBOLS) +# Create a `.make` directory for tracking targets which don't generate a single file output. This should be ignored by git. +# For targets which either don't generate a single file output, or the output file is committed, we use a "sentinel" +# file within `.make/` to track the staleness of the target and only rebuild when needed. +# For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. +# At the end of each internal target we run `@touch $@` to update the file which is the name of the target. +_ := $(shell mkdir -p .make) + development: install_plugins provider build_sdks install_sdks build: install_plugins provider build_sdks install_sdks diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 2206b9c91..5d20f511e 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -27,6 +27,13 @@ LDFLAGS_UPSTREAM_VERSION= LDFLAGS_EXTRAS= LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $(LDFLAGS_STRIP_SYMBOLS) +# Create a `.make` directory for tracking targets which don't generate a single file output. This should be ignored by git. +# For targets which either don't generate a single file output, or the output file is committed, we use a "sentinel" +# file within `.make/` to track the staleness of the target and only rebuild when needed. +# For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. +# At the end of each internal target we run `@touch $@` to update the file which is the name of the target. +_ := $(shell mkdir -p .make) + development: install_plugins provider build_sdks install_sdks build: install_plugins provider build_sdks install_sdks From fb355939a8ea93fc5d5a181ddc5dbe256deeaaa0 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Tue, 19 Nov 2024 15:14:53 +0000 Subject: [PATCH 02/29] Add file target for tfgen_build_only - Depend on the binary rather than the phoney target so tfgen_no_deps can be up-to-date if we make it a file target too. - Group tfgen .PHONY targets near where they're declared. --- .../internal/pkg/templates/bridged-provider/Makefile | 9 ++++++--- provider-ci/test-providers/acme/Makefile | 9 ++++++--- provider-ci/test-providers/aws/Makefile | 9 ++++++--- provider-ci/test-providers/cloudflare/Makefile | 9 ++++++--- provider-ci/test-providers/docker/Makefile | 9 ++++++--- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index ed83b7a29..5800c2061 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -185,6 +185,7 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: tfgen tfgen_no_deps tfgen_build_only tfgen: install_plugins upstream#{{ if .Config.DocsCmd }}# docs#{{ end }}# tfgen_no_deps tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -193,11 +194,13 @@ tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: tfgen_build_only +tfgen_no_deps: bin/$(TFGEN) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) -tfgen_build_only: +tfgen_build_only: bin/$(TFGEN) + +bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) upstream: @@ -248,7 +251,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test tfgen upstream ci-mgmt test_provider debug_tfgen tfgen_build_only +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index d012cb5f6..3b2b4566d 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -154,6 +154,7 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: tfgen tfgen_no_deps tfgen_build_only tfgen: install_plugins upstream tfgen_no_deps tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -162,11 +163,13 @@ tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: tfgen_build_only +tfgen_no_deps: bin/$(TFGEN) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) -tfgen_build_only: +tfgen_build_only: bin/$(TFGEN) + +bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) upstream: @@ -208,7 +211,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test tfgen upstream ci-mgmt test_provider debug_tfgen tfgen_build_only +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index f09f80b78..8ed4c1773 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -164,6 +164,7 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: tfgen tfgen_no_deps tfgen_build_only tfgen: install_plugins upstream tfgen_no_deps tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -172,11 +173,13 @@ tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: tfgen_build_only +tfgen_no_deps: bin/$(TFGEN) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) -tfgen_build_only: +tfgen_build_only: bin/$(TFGEN) + +bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) upstream: @@ -223,7 +226,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test tfgen upstream ci-mgmt test_provider debug_tfgen tfgen_build_only +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index fbe3c54ae..f8f2bbc44 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -162,6 +162,7 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: tfgen tfgen_no_deps tfgen_build_only tfgen: install_plugins upstream tfgen_no_deps tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -170,11 +171,13 @@ tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: tfgen_build_only +tfgen_no_deps: bin/$(TFGEN) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) -tfgen_build_only: +tfgen_build_only: bin/$(TFGEN) + +bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) upstream: @@ -216,7 +219,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test tfgen upstream ci-mgmt test_provider debug_tfgen tfgen_build_only +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 5d20f511e..125458dfc 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -163,6 +163,7 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: tfgen tfgen_no_deps tfgen_build_only tfgen: install_plugins upstream docs tfgen_no_deps tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -171,11 +172,13 @@ tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: tfgen_build_only +tfgen_no_deps: bin/$(TFGEN) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) -tfgen_build_only: +tfgen_build_only: bin/$(TFGEN) + +bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) upstream: @@ -217,7 +220,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test tfgen upstream ci-mgmt test_provider debug_tfgen tfgen_build_only +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 90bf9ad504ff86b55b27294b15c37eab49dd603b Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 20 Nov 2024 17:07:01 +0000 Subject: [PATCH 03/29] Add sentinel target for upstream - Upstream depends on the patches and upstream HEAD - Remove confusing whitespace around `XrunUpstreamTools` block. - Move .PHONY entry adjacent to target. --- .../pkg/templates/bridged-provider/Makefile | 21 ++++++++++--------- provider-ci/test-providers/acme/Makefile | 18 +++++++++------- provider-ci/test-providers/aws/Makefile | 19 ++++++++++------- .../test-providers/cloudflare/Makefile | 18 +++++++++------- provider-ci/test-providers/docker/Makefile | 18 +++++++++------- 5 files changed, 55 insertions(+), 39 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 5800c2061..6687df308 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -69,7 +69,7 @@ only_build: build build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: upstream +build_dotnet: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -79,7 +79,7 @@ build_dotnet: upstream build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: upstream +build_go: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -87,7 +87,7 @@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen upstream +build_java: bin/pulumi-java-gen .make/upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -97,7 +97,7 @@ build_java: bin/pulumi-java-gen upstream build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: upstream +build_nodejs: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ cd sdk/nodejs/ && \ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -108,7 +108,7 @@ build_nodejs: upstream build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: upstream +build_python: .make/upstream rm -rf sdk/python/ PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ cd sdk/python/ && \ @@ -203,19 +203,20 @@ tfgen_build_only: bin/$(TFGEN) bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) -upstream: +.PHONY: upstream +upstream: .make/upstream +# Re-run if the upstream commit or the patches change +.make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) ifneq ("$(wildcard upstream)","") ./upstream.sh init endif - #{{- if .Config.XrunUpstreamTools }}# - # Ensure tool is installed cd upstream-tools && yarn install --frozen-lockfile # Apply all automated changes cd upstream-tools && yarn --silent run apply - #{{- end }}# + @touch $@ bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -251,7 +252,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 3b2b4566d..f2f097b14 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -53,7 +53,7 @@ only_build: build build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: upstream +build_dotnet: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -63,7 +63,7 @@ build_dotnet: upstream build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: upstream +build_go: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -71,7 +71,7 @@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen upstream +build_java: bin/pulumi-java-gen .make/upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -81,7 +81,7 @@ build_java: bin/pulumi-java-gen upstream build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: upstream +build_nodejs: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ cd sdk/nodejs/ && \ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -92,7 +92,7 @@ build_nodejs: upstream build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: upstream +build_python: .make/upstream rm -rf sdk/python/ PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ cd sdk/python/ && \ @@ -172,10 +172,14 @@ tfgen_build_only: bin/$(TFGEN) bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) -upstream: +.PHONY: upstream +upstream: .make/upstream +# Re-run if the upstream commit or the patches change +.make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) ifneq ("$(wildcard upstream)","") ./upstream.sh init endif + @touch $@ bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -211,7 +215,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 8ed4c1773..db5c1937b 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -53,7 +53,7 @@ only_build: build build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: upstream +build_dotnet: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -63,7 +63,7 @@ build_dotnet: upstream build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: upstream +build_go: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -71,7 +71,7 @@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen upstream +build_java: bin/pulumi-java-gen .make/upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -81,7 +81,7 @@ build_java: bin/pulumi-java-gen upstream build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: upstream +build_nodejs: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ cd sdk/nodejs/ && \ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -92,7 +92,7 @@ build_nodejs: upstream build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: upstream +build_python: .make/upstream rm -rf sdk/python/ PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ cd sdk/python/ && \ @@ -182,15 +182,18 @@ tfgen_build_only: bin/$(TFGEN) bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) -upstream: +.PHONY: upstream +upstream: .make/upstream +# Re-run if the upstream commit or the patches change +.make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) ifneq ("$(wildcard upstream)","") ./upstream.sh init endif - # Ensure tool is installed cd upstream-tools && yarn install --frozen-lockfile # Apply all automated changes cd upstream-tools && yarn --silent run apply + @touch $@ bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -226,7 +229,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index f8f2bbc44..eb42d7e90 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -53,7 +53,7 @@ only_build: build build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: upstream +build_dotnet: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -63,7 +63,7 @@ build_dotnet: upstream build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: upstream +build_go: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -71,7 +71,7 @@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen upstream +build_java: bin/pulumi-java-gen .make/upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -81,7 +81,7 @@ build_java: bin/pulumi-java-gen upstream build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: upstream +build_nodejs: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ cd sdk/nodejs/ && \ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -92,7 +92,7 @@ build_nodejs: upstream build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: upstream +build_python: .make/upstream rm -rf sdk/python/ PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ cd sdk/python/ && \ @@ -180,10 +180,14 @@ tfgen_build_only: bin/$(TFGEN) bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) -upstream: +.PHONY: upstream +upstream: .make/upstream +# Re-run if the upstream commit or the patches change +.make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) ifneq ("$(wildcard upstream)","") ./upstream.sh init endif + @touch $@ bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -219,7 +223,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 125458dfc..ff0bbb2c4 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -53,7 +53,7 @@ only_build: build build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: upstream +build_dotnet: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -63,7 +63,7 @@ build_dotnet: upstream build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: upstream +build_go: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -71,7 +71,7 @@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen upstream +build_java: bin/pulumi-java-gen .make/upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -81,7 +81,7 @@ build_java: bin/pulumi-java-gen upstream build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: upstream +build_nodejs: .make/upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ cd sdk/nodejs/ && \ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ @@ -92,7 +92,7 @@ build_nodejs: upstream build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: upstream +build_python: .make/upstream rm -rf sdk/python/ PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ cd sdk/python/ && \ @@ -181,10 +181,14 @@ tfgen_build_only: bin/$(TFGEN) bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) -upstream: +.PHONY: upstream +upstream: .make/upstream +# Re-run if the upstream commit or the patches change +.make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) ifneq ("$(wildcard upstream)","") ./upstream.sh init endif + @touch $@ bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -220,7 +224,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test upstream ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 5106e646a79e04aa84cfc98e63fe2443a4fbcaae Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 20 Nov 2024 16:48:27 +0000 Subject: [PATCH 04/29] Add sentinel target for install_plugins --- .../pkg/templates/bridged-provider/Makefile | 15 +++++++++------ provider-ci/test-providers/acme/Makefile | 15 +++++++++------ provider-ci/test-providers/aws/Makefile | 15 +++++++++------ provider-ci/test-providers/cloudflare/Makefile | 15 +++++++++------ provider-ci/test-providers/docker/Makefile | 15 +++++++++------ 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 6687df308..f63e3edf3 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -50,9 +50,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. _ := $(shell mkdir -p .make) -development: install_plugins provider build_sdks install_sdks +development: .make/install_plugins provider build_sdks install_sdks -build: install_plugins provider build_sdks install_sdks +build: .make/install_plugins provider build_sdks install_sdks build_sdks: #{{ range .Config.Languages }}#build_#{{ . }}# #{{ end }}##{{- if .Config.RegistryDocs }}#build_registry_docs#{{- end }}# @@ -152,12 +152,15 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -install_plugins: .pulumi/bin/pulumi +.PHONY: install_plugins +install_plugins: .make/install_plugins +.make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/install_plugins: .pulumi/bin/pulumi #{{- range .Config.Plugins }}# .pulumi/bin/pulumi plugin install #{{ or .Kind "resource" }}# #{{ .Name }}# #{{ .Version }}# #{{- end }}# + @touch $@ lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml @@ -252,7 +255,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index f2f097b14..eb33ef772 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -34,9 +34,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. _ := $(shell mkdir -p .make) -development: install_plugins provider build_sdks install_sdks +development: .make/install_plugins provider build_sdks install_sdks -build: install_plugins provider build_sdks install_sdks +build: .make/install_plugins provider build_sdks install_sdks build_sdks: build_dotnet build_go build_nodejs build_python @@ -124,9 +124,12 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -install_plugins: .pulumi/bin/pulumi +.PHONY: install_plugins +install_plugins: .make/install_plugins +.make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/install_plugins: .pulumi/bin/pulumi + @touch $@ lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml @@ -215,7 +218,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index db5c1937b..fd4399076 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -34,9 +34,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. _ := $(shell mkdir -p .make) -development: install_plugins provider build_sdks install_sdks +development: .make/install_plugins provider build_sdks install_sdks -build: install_plugins provider build_sdks install_sdks +build: .make/install_plugins provider build_sdks install_sdks build_sdks: build_nodejs build_python build_dotnet build_go build_java @@ -124,9 +124,11 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -install_plugins: .pulumi/bin/pulumi +.PHONY: install_plugins +install_plugins: .make/install_plugins +.make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/install_plugins: .pulumi/bin/pulumi .pulumi/bin/pulumi plugin install resource archive 0.0.1 .pulumi/bin/pulumi plugin install resource tls 4.10.0 .pulumi/bin/pulumi plugin install resource github 4.10.0 @@ -137,6 +139,7 @@ install_plugins: .pulumi/bin/pulumi .pulumi/bin/pulumi plugin install resource github 5.14.0 .pulumi/bin/pulumi plugin install resource std 1.6.2 .pulumi/bin/pulumi plugin install converter terraform 1.0.17 + @touch $@ lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml @@ -229,7 +232,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index eb42d7e90..3c786bf54 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -34,9 +34,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. _ := $(shell mkdir -p .make) -development: install_plugins provider build_sdks install_sdks +development: .make/install_plugins provider build_sdks install_sdks -build: install_plugins provider build_sdks install_sdks +build: .make/install_plugins provider build_sdks install_sdks build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs @@ -128,13 +128,16 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -install_plugins: .pulumi/bin/pulumi +.PHONY: install_plugins +install_plugins: .make/install_plugins +.make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/install_plugins: .pulumi/bin/pulumi .pulumi/bin/pulumi plugin install converter terraform 1.0.16 .pulumi/bin/pulumi plugin install resource std 1.6.2 .pulumi/bin/pulumi plugin install resource gcp 5.0.0 .pulumi/bin/pulumi plugin install resource tls 4.0.0 + @touch $@ lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml @@ -223,7 +226,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index ff0bbb2c4..31acca0d3 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -34,9 +34,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. _ := $(shell mkdir -p .make) -development: install_plugins provider build_sdks install_sdks +development: .make/install_plugins provider build_sdks install_sdks -build: install_plugins provider build_sdks install_sdks +build: .make/install_plugins provider build_sdks install_sdks build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs @@ -131,11 +131,14 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -install_plugins: .pulumi/bin/pulumi +.PHONY: install_plugins +install_plugins: .make/install_plugins +.make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/install_plugins: .pulumi/bin/pulumi .pulumi/bin/pulumi plugin install converter terraform 1.0.16 .pulumi/bin/pulumi plugin install resource aws 6.8.0 + @touch $@ lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml @@ -224,7 +227,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 2232dccf3bae51d5f363a8dafa68d9b92286c92e Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 20 Nov 2024 16:46:29 +0000 Subject: [PATCH 05/29] Add sentinel target for schema Add dependency on sources files (including the upstream HEAD) so we rebuild when they're updated. Add an alias of "schema" which is more generic that "tfgen" and can be standardised for all other providers too. --- .../pkg/templates/bridged-provider/Makefile | 24 +++++++++++-------- provider-ci/test-providers/acme/Makefile | 24 +++++++++++-------- provider-ci/test-providers/aws/Makefile | 24 +++++++++++-------- .../test-providers/cloudflare/Makefile | 24 +++++++++++-------- provider-ci/test-providers/docker/Makefile | 24 +++++++++++-------- 5 files changed, 70 insertions(+), 50 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index f63e3edf3..91cbd1a0f 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -188,18 +188,22 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) -.PHONY: tfgen tfgen_no_deps tfgen_build_only -tfgen: install_plugins upstream#{{ if .Config.DocsCmd }}# docs#{{ end }}# tfgen_no_deps - -tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: bin/$(TFGEN) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only +tfgen: schema +schema: .make/schema #{{ if .Config.DocsCmd }}# docs#{{ end }}# +# This does actually have dependencies, but we're keeping it around for backwards compatibility for now +tfgen_no_deps: .make/schema + +.make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) +.make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache +.make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) +.make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) +.make/schema: bin/$(TFGEN) provider/resources.go provider/go.mod .make/install_plugins .make/upstream $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) + @touch $@ tfgen_build_only: bin/$(TFGEN) diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index eb33ef772..3cc35d5f5 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -157,18 +157,22 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) -.PHONY: tfgen tfgen_no_deps tfgen_build_only -tfgen: install_plugins upstream tfgen_no_deps - -tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: bin/$(TFGEN) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only +tfgen: schema +schema: .make/schema +# This does actually have dependencies, but we're keeping it around for backwards compatibility for now +tfgen_no_deps: .make/schema + +.make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) +.make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache +.make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) +.make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) +.make/schema: bin/$(TFGEN) provider/resources.go provider/go.mod .make/install_plugins .make/upstream $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) + @touch $@ tfgen_build_only: bin/$(TFGEN) diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index fd4399076..e8ae6159e 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -167,18 +167,22 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) -.PHONY: tfgen tfgen_no_deps tfgen_build_only -tfgen: install_plugins upstream tfgen_no_deps - -tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: bin/$(TFGEN) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only +tfgen: schema +schema: .make/schema +# This does actually have dependencies, but we're keeping it around for backwards compatibility for now +tfgen_no_deps: .make/schema + +.make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) +.make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache +.make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) +.make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) +.make/schema: bin/$(TFGEN) provider/resources.go provider/go.mod .make/install_plugins .make/upstream $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) + @touch $@ tfgen_build_only: bin/$(TFGEN) diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 3c786bf54..7d444e717 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -165,18 +165,22 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) -.PHONY: tfgen tfgen_no_deps tfgen_build_only -tfgen: install_plugins upstream tfgen_no_deps - -tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: bin/$(TFGEN) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only +tfgen: schema +schema: .make/schema +# This does actually have dependencies, but we're keeping it around for backwards compatibility for now +tfgen_no_deps: .make/schema + +.make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) +.make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache +.make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) +.make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) +.make/schema: bin/$(TFGEN) provider/resources.go provider/go.mod .make/install_plugins .make/upstream $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) + @touch $@ tfgen_build_only: bin/$(TFGEN) diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 31acca0d3..02f08872c 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -166,18 +166,22 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) -.PHONY: tfgen tfgen_no_deps tfgen_build_only -tfgen: install_plugins upstream docs tfgen_no_deps - -tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) -tfgen_no_deps: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -tfgen_no_deps: bin/$(TFGEN) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only +tfgen: schema +schema: .make/schema docs +# This does actually have dependencies, but we're keeping it around for backwards compatibility for now +tfgen_no_deps: .make/schema + +.make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +.make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) +.make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache +.make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) +.make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) +.make/schema: bin/$(TFGEN) provider/resources.go provider/go.mod .make/install_plugins .make/upstream $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) + @touch $@ tfgen_build_only: bin/$(TFGEN) From 59e380d344285afe751ee7279a54bb069b9a442d Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 20 Nov 2024 17:24:14 +0000 Subject: [PATCH 06/29] Fix the pulumi version being up-to-date If the target it running but we're already on the right version, we still need to bump the timestamp to avoid re-running this whole check. --- provider-ci/internal/pkg/templates/bridged-provider/Makefile | 1 + provider-ci/test-providers/acme/Makefile | 1 + provider-ci/test-providers/aws/Makefile | 1 + provider-ci/test-providers/cloudflare/Makefile | 1 + provider-ci/test-providers/docker/Makefile | 1 + 5 files changed, 5 insertions(+) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 91cbd1a0f..03d944860 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -245,6 +245,7 @@ ci-mgmt: .ci-mgmt.yaml .pulumi/bin/pulumi: .pulumi/version @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ + touch $@; \ else \ curl -fsSL https://get.pulumi.com | \ HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \ diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 3cc35d5f5..6e6b72947 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -208,6 +208,7 @@ ci-mgmt: .ci-mgmt.yaml .pulumi/bin/pulumi: .pulumi/version @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ + touch $@; \ else \ curl -fsSL https://get.pulumi.com | \ HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \ diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index e8ae6159e..6f3ee3d2c 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -222,6 +222,7 @@ ci-mgmt: .ci-mgmt.yaml .pulumi/bin/pulumi: .pulumi/version @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ + touch $@; \ else \ curl -fsSL https://get.pulumi.com | \ HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \ diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 7d444e717..476c4a5d4 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -216,6 +216,7 @@ ci-mgmt: .ci-mgmt.yaml .pulumi/bin/pulumi: .pulumi/version @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ + touch $@; \ else \ curl -fsSL https://get.pulumi.com | \ HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \ diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 02f08872c..f77b3659c 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -217,6 +217,7 @@ ci-mgmt: .ci-mgmt.yaml .pulumi/bin/pulumi: .pulumi/version @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ + touch $@; \ else \ curl -fsSL https://get.pulumi.com | \ HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \ From 43a8b853237342b983ccf8d2f8e7e0b592aef351 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 20 Nov 2024 17:16:04 +0000 Subject: [PATCH 07/29] Ensure all local directories exist before evaluating targets --- .../internal/pkg/templates/bridged-provider/Makefile | 7 ++++--- provider-ci/test-providers/acme/Makefile | 7 ++++--- provider-ci/test-providers/aws/Makefile | 7 ++++--- provider-ci/test-providers/cloudflare/Makefile | 7 ++++--- provider-ci/test-providers/docker/Makefile | 7 ++++--- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 03d944860..b44227910 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -48,7 +48,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # file within `.make/` to track the staleness of the target and only rebuild when needed. # For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. -_ := $(shell mkdir -p .make) + +# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. +_ := $(shell mkdir -p .make bin .pulumi/bin) development: .make/install_plugins provider build_sdks install_sdks @@ -253,8 +255,7 @@ ci-mgmt: .ci-mgmt.yaml # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: provider/go.mod - @mkdir -p .pulumi - @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ + cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ # Start debug server for tfgen debug_tfgen: diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 6e6b72947..c134103f4 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -32,7 +32,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # file within `.make/` to track the staleness of the target and only rebuild when needed. # For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. -_ := $(shell mkdir -p .make) + +# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. +_ := $(shell mkdir -p .make bin .pulumi/bin) development: .make/install_plugins provider build_sdks install_sdks @@ -216,8 +218,7 @@ ci-mgmt: .ci-mgmt.yaml # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: provider/go.mod - @mkdir -p .pulumi - @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ + cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ # Start debug server for tfgen debug_tfgen: diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 6f3ee3d2c..96e0b3089 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -32,7 +32,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # file within `.make/` to track the staleness of the target and only rebuild when needed. # For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. -_ := $(shell mkdir -p .make) + +# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. +_ := $(shell mkdir -p .make bin .pulumi/bin) development: .make/install_plugins provider build_sdks install_sdks @@ -230,8 +232,7 @@ ci-mgmt: .ci-mgmt.yaml # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: provider/go.mod - @mkdir -p .pulumi - @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ + cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ # Start debug server for tfgen debug_tfgen: diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 476c4a5d4..8bf1c5417 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -32,7 +32,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # file within `.make/` to track the staleness of the target and only rebuild when needed. # For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. -_ := $(shell mkdir -p .make) + +# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. +_ := $(shell mkdir -p .make bin .pulumi/bin) development: .make/install_plugins provider build_sdks install_sdks @@ -224,8 +226,7 @@ ci-mgmt: .ci-mgmt.yaml # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: provider/go.mod - @mkdir -p .pulumi - @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ + cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ # Start debug server for tfgen debug_tfgen: diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index f77b3659c..49b0dd8c6 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -32,7 +32,9 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # file within `.make/` to track the staleness of the target and only rebuild when needed. # For each phony target, we create an internal target with the same name, but prefixed with `.make/` where the work is performed. # At the end of each internal target we run `@touch $@` to update the file which is the name of the target. -_ := $(shell mkdir -p .make) + +# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. +_ := $(shell mkdir -p .make bin .pulumi/bin) development: .make/install_plugins provider build_sdks install_sdks @@ -225,8 +227,7 @@ ci-mgmt: .ci-mgmt.yaml # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: provider/go.mod - @mkdir -p .pulumi - @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ + cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ # Start debug server for tfgen debug_tfgen: From 11c6e31ba7b98f022093f2a143c32070962abb4a Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Thu, 21 Nov 2024 13:59:21 +0000 Subject: [PATCH 08/29] Clean bin and .make directory contents - Remove "cleanup" so we only have "clean" for consistency. - The schema.go hasn't existed for a while now so can be removed. --- .../internal/pkg/templates/bridged-provider/Makefile | 9 ++++----- provider-ci/test-providers/acme/Makefile | 9 ++++----- provider-ci/test-providers/aws/Makefile | 9 ++++----- provider-ci/test-providers/cloudflare/Makefile | 9 ++++----- provider-ci/test-providers/docker/Makefile | 9 ++++----- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index b44227910..5360dd5f4 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -129,12 +129,11 @@ build_registry_docs: $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs #{{- end }}# +.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} - -cleanup: - rm -r $(WORKING_DIR)/bin - rm -f provider/cmd/$(PROVIDER)/schema.go + rm -rf bin/* + rm -rf .make/* #{{- if .Config.DocsCmd }}# @@ -261,7 +260,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index c134103f4..784729a27 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -107,12 +107,11 @@ build_python: .make/upstream cd ./bin && \ ../venv/bin/python -m build . +.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} - -cleanup: - rm -r $(WORKING_DIR)/bin - rm -f provider/cmd/$(PROVIDER)/schema.go + rm -rf bin/* + rm -rf .make/* help: @grep '^[^.#]\+:\s\+.*#' Makefile | \ @@ -224,7 +223,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 96e0b3089..036af8164 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -107,12 +107,11 @@ build_python: .make/upstream cd ./bin && \ ../venv/bin/python -m build . +.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} - -cleanup: - rm -r $(WORKING_DIR)/bin - rm -f provider/cmd/$(PROVIDER)/schema.go + rm -rf bin/* + rm -rf .make/* help: @grep '^[^.#]\+:\s\+.*#' Makefile | \ @@ -238,7 +237,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 8bf1c5417..8b52b4dd4 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -111,12 +111,11 @@ build_python: .make/upstream build_registry_docs: $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} - -cleanup: - rm -r $(WORKING_DIR)/bin - rm -f provider/cmd/$(PROVIDER)/schema.go + rm -rf bin/* + rm -rf .make/* help: @grep '^[^.#]\+:\s\+.*#' Makefile | \ @@ -232,7 +231,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 49b0dd8c6..0efecf4dd 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -111,12 +111,11 @@ build_python: .make/upstream build_registry_docs: $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} - -cleanup: - rm -r $(WORKING_DIR)/bin - rm -f provider/cmd/$(PROVIDER)/schema.go + rm -rf bin/* + rm -rf .make/* docs: cd provider/pkg/docs-gen/examples/ && go run generate.go ./yaml ./ @@ -233,7 +232,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup docs help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python docs help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 4a7fc88e1113088d2be23701754ad9a7ee09df83 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Thu, 21 Nov 2024 14:05:55 +0000 Subject: [PATCH 09/29] Add sentinel target for docs --- .../internal/pkg/templates/bridged-provider/Makefile | 10 ++++++---- provider-ci/test-providers/docker/Makefile | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 5360dd5f4..fe1bbd4cc 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -136,9 +136,11 @@ clean: rm -rf .make/* #{{- if .Config.DocsCmd }}# - -docs: +.PHONY: docs +docs: .make/docs +.make/docs: #{{ .Config.DocsCmd }}# + @touch $@ #{{- end }}# help: @@ -191,7 +193,7 @@ test_provider: .PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema -schema: .make/schema #{{ if .Config.DocsCmd }}# docs#{{ end }}# +schema: .make/schema #{{ if .Config.DocsCmd }}# .make/docs#{{ end }}# # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema @@ -260,7 +262,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python#{{ if .Config.DocsCmd }}# docs#{{end}}# help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 0efecf4dd..78a83240b 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -116,9 +116,11 @@ clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* - -docs: +.PHONY: docs +docs: .make/docs +.make/docs: cd provider/pkg/docs-gen/examples/ && go run generate.go ./yaml ./ + @touch $@ help: @grep '^[^.#]\+:\s\+.*#' Makefile | \ @@ -169,7 +171,7 @@ test_provider: .PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema -schema: .make/schema docs +schema: .make/schema .make/docs # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema @@ -232,7 +234,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python docs help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From cc68d9a06045a2772fc55f2c4711556af3b96280 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Thu, 21 Nov 2024 14:39:43 +0000 Subject: [PATCH 10/29] Remove broken help target It doesn't output anything useful. More comments & better structure would probably be more helpful. --- .../internal/pkg/templates/bridged-provider/Makefile | 7 +------ provider-ci/test-providers/acme/Makefile | 7 +------ provider-ci/test-providers/aws/Makefile | 7 +------ provider-ci/test-providers/cloudflare/Makefile | 7 +------ provider-ci/test-providers/docker/Makefile | 7 +------ 5 files changed, 5 insertions(+), 30 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index fe1bbd4cc..20e7d1b21 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -143,11 +143,6 @@ docs: .make/docs @touch $@ #{{- end }}# -help: - @grep '^[^.#]\+:\s\+.*#' Makefile | \ - sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ - expand -t20 - install_dotnet_sdk: mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; @@ -262,7 +257,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 784729a27..481ca4fcc 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -113,11 +113,6 @@ clean: rm -rf bin/* rm -rf .make/* -help: - @grep '^[^.#]\+:\s\+.*#' Makefile | \ - sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ - expand -t20 - install_dotnet_sdk: mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; @@ -223,7 +218,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 036af8164..fe0662613 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -113,11 +113,6 @@ clean: rm -rf bin/* rm -rf .make/* -help: - @grep '^[^.#]\+:\s\+.*#' Makefile | \ - sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ - expand -t20 - install_dotnet_sdk: mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; @@ -237,7 +232,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 8b52b4dd4..27ff2cb7b 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -117,11 +117,6 @@ clean: rm -rf bin/* rm -rf .make/* -help: - @grep '^[^.#]\+:\s\+.*#' Makefile | \ - sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ - expand -t20 - install_dotnet_sdk: mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; @@ -231,7 +226,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 78a83240b..0f567feaf 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -122,11 +122,6 @@ docs: .make/docs cd provider/pkg/docs-gen/examples/ && go run generate.go ./yaml ./ @touch $@ -help: - @grep '^[^.#]\+:\s\+.*#' Makefile | \ - sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ - expand -t20 - install_dotnet_sdk: mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; @@ -234,7 +229,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python help install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From b79852f69647861f0690a11aab7bcb645c088236 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Thu, 21 Nov 2024 14:41:55 +0000 Subject: [PATCH 11/29] Add sentinel target for build_registry_docs - Add dependency on bin/$(TFGEN). --- .../internal/pkg/templates/bridged-provider/Makefile | 11 +++++++---- provider-ci/test-providers/cloudflare/Makefile | 10 ++++++---- provider-ci/test-providers/docker/Makefile | 10 ++++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 20e7d1b21..4246ccbeb 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -56,7 +56,7 @@ development: .make/install_plugins provider build_sdks install_sdks build: .make/install_plugins provider build_sdks install_sdks -build_sdks: #{{ range .Config.Languages }}#build_#{{ . }}# #{{ end }}##{{- if .Config.RegistryDocs }}#build_registry_docs#{{- end }}# +build_sdks: #{{ range .Config.Languages }}#build_#{{ . }}# #{{ end }}##{{- if .Config.RegistryDocs }}#.make/build_registry_docs#{{- end }}# install_go_sdk: @@ -122,11 +122,14 @@ build_python: .make/upstream ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . -#{{- if .Config.RegistryDocs }}# +#{{- if .Config.RegistryDocs }}# # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root -build_registry_docs: - $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.PHONY: build_registry_docs +build_registry_docs: .make/build_registry_docs +.make/build_registry_docs: bin/$(TFGEN) + bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs + @touch $@ #{{- end }}# .PHONY: clean diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 27ff2cb7b..d11a9b7d5 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -40,7 +40,7 @@ development: .make/install_plugins provider build_sdks install_sdks build: .make/install_plugins provider build_sdks install_sdks -build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs +build_sdks: build_nodejs build_python build_dotnet build_go build_java .make/build_registry_docs install_go_sdk: @@ -106,10 +106,12 @@ build_python: .make/upstream ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . - # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root -build_registry_docs: - $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.PHONY: build_registry_docs +build_registry_docs: .make/build_registry_docs +.make/build_registry_docs: bin/$(TFGEN) + bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs + @touch $@ .PHONY: clean clean: diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 0f567feaf..645d420c9 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -40,7 +40,7 @@ development: .make/install_plugins provider build_sdks install_sdks build: .make/install_plugins provider build_sdks install_sdks -build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs +build_sdks: build_nodejs build_python build_dotnet build_go build_java .make/build_registry_docs install_go_sdk: @@ -106,10 +106,12 @@ build_python: .make/upstream ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . - # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root -build_registry_docs: - $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.PHONY: build_registry_docs +build_registry_docs: .make/build_registry_docs +.make/build_registry_docs: bin/$(TFGEN) + bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs + @touch $@ .PHONY: clean clean: From 912f23e81f132fae3623987cc696add23062981f Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 09:47:28 +0000 Subject: [PATCH 12/29] Add file target for provider target If we make the file target depend on _no_deps, it will never be up-to-date. If we make _no_deps depend on the file target it will pull in all dependencies. Instead we extract the build provider command to a variable so it's re-used from both the file target and _no_deps versions. --- .../internal/pkg/templates/bridged-provider/Makefile | 9 ++++++--- provider-ci/test-providers/acme/Makefile | 9 ++++++--- provider-ci/test-providers/aws/Makefile | 9 ++++++--- provider-ci/test-providers/cloudflare/Makefile | 9 ++++++--- provider-ci/test-providers/docker/Makefile | 9 ++++++--- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 4246ccbeb..64634df4f 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -174,10 +174,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-#{{ .Config.Provider }}#/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 481ca4fcc..a4c1924c9 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -138,10 +138,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-acme/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index fe0662613..063c3a17c 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -148,10 +148,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-aws/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index d11a9b7d5..dc8896d7d 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -148,10 +148,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-cloudflare/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 645d420c9..5f63f283c 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -151,10 +151,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-docker/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: From 16970ce97562d6246fcb1dc8f7f9e0e60590e5e1 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 11:50:29 +0000 Subject: [PATCH 13/29] Add sentinel targets for generate_dotnet and build_dotnet - Separate generate from build for an option for faster local iteration. We don't actually need to run the full SDK build to be able to commit and push to CI. - Extract env vars to a makefile variable to reduce duplication and improve visibility in the logs. Don't include the PATH in the logs though as that's too noisy. --- .../pkg/templates/bridged-provider/Makefile | 24 ++++++++++++------- provider-ci/test-providers/acme/Makefile | 24 ++++++++++++------- provider-ci/test-providers/aws/Makefile | 24 ++++++++++++------- .../test-providers/cloudflare/Makefile | 24 ++++++++++++------- provider-ci/test-providers/docker/Makefile | 24 ++++++++++++------- 5 files changed, 80 insertions(+), 40 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 64634df4f..129f0173d 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -68,15 +68,23 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build -build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi +GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache +GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) + +.PHONY: generate_dotnet build_dotnet +generate_dotnet: .make/generate_dotnet +build_dotnet: .make/build_dotnet +.make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_dotnet: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - echo "$(VERSION_GENERIC)" >version.txt && \ - dotnet build + echo "$(VERSION_GENERIC)" >version.txt + @touch $@ +.make/build_dotnet: .make/generate_dotnet + cd sdk/dotnet/ && dotnet build + @touch $@ build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -263,7 +271,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index a4c1924c9..534453370 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -52,15 +52,23 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build -build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi +GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache +GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) + +.PHONY: generate_dotnet build_dotnet +generate_dotnet: .make/generate_dotnet +build_dotnet: .make/build_dotnet +.make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_dotnet: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - echo "$(VERSION_GENERIC)" >version.txt && \ - dotnet build + echo "$(VERSION_GENERIC)" >version.txt + @touch $@ +.make/build_dotnet: .make/generate_dotnet + cd sdk/dotnet/ && dotnet build + @touch $@ build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -221,7 +229,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 063c3a17c..8c30955b8 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -52,15 +52,23 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build -build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi +GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache +GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) + +.PHONY: generate_dotnet build_dotnet +generate_dotnet: .make/generate_dotnet +build_dotnet: .make/build_dotnet +.make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_dotnet: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - echo "$(VERSION_GENERIC)" >version.txt && \ - dotnet build + echo "$(VERSION_GENERIC)" >version.txt + @touch $@ +.make/build_dotnet: .make/generate_dotnet + cd sdk/dotnet/ && dotnet build + @touch $@ build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -235,7 +243,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index dc8896d7d..03628f0c9 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -52,15 +52,23 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build -build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi +GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache +GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) + +.PHONY: generate_dotnet build_dotnet +generate_dotnet: .make/generate_dotnet +build_dotnet: .make/build_dotnet +.make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_dotnet: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - echo "$(VERSION_GENERIC)" >version.txt && \ - dotnet build + echo "$(VERSION_GENERIC)" >version.txt + @touch $@ +.make/build_dotnet: .make/generate_dotnet + cd sdk/dotnet/ && dotnet build + @touch $@ build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -231,7 +239,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 5f63f283c..999cbd013 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -52,15 +52,23 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build -build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_dotnet: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_dotnet: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi +GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache +GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) + +.PHONY: generate_dotnet build_dotnet +generate_dotnet: .make/generate_dotnet +build_dotnet: .make/build_dotnet +.make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_dotnet: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - echo "$(VERSION_GENERIC)" >version.txt && \ - dotnet build + echo "$(VERSION_GENERIC)" >version.txt + @touch $@ +.make/build_dotnet: .make/generate_dotnet + cd sdk/dotnet/ && dotnet build + @touch $@ build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -234,7 +242,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 5ca109da1d5029124d80d599ee6f157609aff56b Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 11:56:06 +0000 Subject: [PATCH 14/29] Add sentinel targets for generate_go and build_go --- .../pkg/templates/bridged-provider/Makefile | 16 ++++++++++------ provider-ci/test-providers/acme/Makefile | 16 ++++++++++------ provider-ci/test-providers/aws/Makefile | 16 ++++++++++------ provider-ci/test-providers/cloudflare/Makefile | 16 ++++++++++------ provider-ci/test-providers/docker/Makefile | 16 ++++++++++------ 5 files changed, 50 insertions(+), 30 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 129f0173d..8411bd198 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -86,12 +86,16 @@ build_dotnet: .make/build_dotnet cd sdk/dotnet/ && dotnet build @touch $@ -build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.PHONY: generate_go build_go +generate_go: .make/generate_go +build_go: .make/build_go +.make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_go: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ + @touch $@ +.make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' + @touch $@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -271,7 +275,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 534453370..73ba06215 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -70,12 +70,16 @@ build_dotnet: .make/build_dotnet cd sdk/dotnet/ && dotnet build @touch $@ -build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.PHONY: generate_go build_go +generate_go: .make/generate_go +build_go: .make/build_go +.make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_go: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ + @touch $@ +.make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' + @touch $@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -229,7 +233,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 8c30955b8..d515c7e1c 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -70,12 +70,16 @@ build_dotnet: .make/build_dotnet cd sdk/dotnet/ && dotnet build @touch $@ -build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.PHONY: generate_go build_go +generate_go: .make/generate_go +build_go: .make/build_go +.make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_go: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ + @touch $@ +.make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' + @touch $@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -243,7 +247,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 03628f0c9..36335e785 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -70,12 +70,16 @@ build_dotnet: .make/build_dotnet cd sdk/dotnet/ && dotnet build @touch $@ -build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.PHONY: generate_go build_go +generate_go: .make/generate_go +build_go: .make/build_go +.make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_go: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ + @touch $@ +.make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' + @touch $@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -239,7 +243,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 999cbd013..012a4dbbe 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -70,12 +70,16 @@ build_dotnet: .make/build_dotnet cd sdk/dotnet/ && dotnet build @touch $@ -build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_go: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_go: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.PHONY: generate_go build_go +generate_go: .make/generate_go +build_go: .make/build_go +.make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_go: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ + @touch $@ +.make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' + @touch $@ build_java: PACKAGE_VERSION := $(VERSION_GENERIC) build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi @@ -242,7 +246,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_go build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From df871391978777343b49ee78660f98d5f56c97f4 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:03:45 +0000 Subject: [PATCH 15/29] Add sentinel targets for generate_nodejs and build_nodejs --- .../pkg/templates/bridged-provider/Makefile | 18 +++++++++++------- provider-ci/test-providers/acme/Makefile | 18 +++++++++++------- provider-ci/test-providers/aws/Makefile | 18 +++++++++++------- provider-ci/test-providers/cloudflare/Makefile | 18 +++++++++++------- provider-ci/test-providers/docker/Makefile | 18 +++++++++++------- 5 files changed, 55 insertions(+), 35 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 8411bd198..1dc626829 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -108,16 +108,20 @@ build_java: bin/pulumi-java-gen .make/upstream gradle --console=plain build && \ gradle --console=plain javadoc -build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.PHONY: generate_nodejs build_nodejs +generate_nodejs: .make/generate_nodejs +build_nodejs: .make/build_nodejs +.make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_nodejs: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ + printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod + @touch $@ +.make/build_nodejs: .make/generate_nodejs cd sdk/nodejs/ && \ - printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ yarn install && \ yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ + @touch $@ build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -275,7 +279,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 73ba06215..3f95f4d7a 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -92,16 +92,20 @@ build_java: bin/pulumi-java-gen .make/upstream gradle --console=plain build && \ gradle --console=plain javadoc -build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.PHONY: generate_nodejs build_nodejs +generate_nodejs: .make/generate_nodejs +build_nodejs: .make/build_nodejs +.make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_nodejs: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ + printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod + @touch $@ +.make/build_nodejs: .make/generate_nodejs cd sdk/nodejs/ && \ - printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ yarn install && \ yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ + @touch $@ build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -233,7 +237,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index d515c7e1c..e5429a75f 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -92,16 +92,20 @@ build_java: bin/pulumi-java-gen .make/upstream gradle --console=plain build && \ gradle --console=plain javadoc -build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.PHONY: generate_nodejs build_nodejs +generate_nodejs: .make/generate_nodejs +build_nodejs: .make/build_nodejs +.make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_nodejs: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ + printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod + @touch $@ +.make/build_nodejs: .make/generate_nodejs cd sdk/nodejs/ && \ - printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ yarn install && \ yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ + @touch $@ build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -247,7 +251,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 36335e785..3da395d9b 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -92,16 +92,20 @@ build_java: bin/pulumi-java-gen .make/upstream gradle --console=plain build && \ gradle --console=plain javadoc -build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.PHONY: generate_nodejs build_nodejs +generate_nodejs: .make/generate_nodejs +build_nodejs: .make/build_nodejs +.make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_nodejs: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ + printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod + @touch $@ +.make/build_nodejs: .make/generate_nodejs cd sdk/nodejs/ && \ - printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ yarn install && \ yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ + @touch $@ build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -243,7 +247,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 012a4dbbe..88cb1586f 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -92,16 +92,20 @@ build_java: bin/pulumi-java-gen .make/upstream gradle --console=plain build && \ gradle --console=plain javadoc -build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_nodejs: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_nodejs: .make/upstream - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.PHONY: generate_nodejs build_nodejs +generate_nodejs: .make/generate_nodejs +build_nodejs: .make/build_nodejs +.make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_nodejs: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ + printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod + @touch $@ +.make/build_nodejs: .make/generate_nodejs cd sdk/nodejs/ && \ - printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ yarn install && \ yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ + @touch $@ build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -246,7 +250,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_nodejs build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From f113037a01fd6b452c57a6ccb83002f9562fd70b Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:07:50 +0000 Subject: [PATCH 16/29] Add sentinel targets for generate_python and build_python --- .../pkg/templates/bridged-provider/Makefile | 21 +++++++++++-------- provider-ci/test-providers/acme/Makefile | 21 +++++++++++-------- provider-ci/test-providers/aws/Makefile | 21 +++++++++++-------- .../test-providers/cloudflare/Makefile | 21 +++++++++++-------- provider-ci/test-providers/docker/Makefile | 21 +++++++++++-------- 5 files changed, 60 insertions(+), 45 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 1dc626829..302ca0332 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -123,21 +123,24 @@ build_nodejs: .make/build_nodejs cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ -build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: .make/upstream - rm -rf sdk/python/ - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.PHONY: generate_python build_python +generate_python: .make/generate_python +build_python: .make/build_python +.make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_python: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod + cp README.md sdk/python/ + @touch $@ +.make/build_python: .make/generate_python cd sdk/python/ && \ - printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - cp ../../README.md . && \ rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ rm ./bin/go.mod && \ python3 -m venv venv && \ ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . + @touch $@ #{{- if .Config.RegistryDocs }}# # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root @@ -279,7 +282,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 3f95f4d7a..1573ba9d9 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -107,21 +107,24 @@ build_nodejs: .make/build_nodejs cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ -build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: .make/upstream - rm -rf sdk/python/ - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.PHONY: generate_python build_python +generate_python: .make/generate_python +build_python: .make/build_python +.make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_python: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod + cp README.md sdk/python/ + @touch $@ +.make/build_python: .make/generate_python cd sdk/python/ && \ - printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - cp ../../README.md . && \ rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ rm ./bin/go.mod && \ python3 -m venv venv && \ ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . + @touch $@ .PHONY: clean clean: @@ -237,7 +240,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index e5429a75f..d26dab170 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -107,21 +107,24 @@ build_nodejs: .make/build_nodejs cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ -build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: .make/upstream - rm -rf sdk/python/ - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.PHONY: generate_python build_python +generate_python: .make/generate_python +build_python: .make/build_python +.make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_python: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod + cp README.md sdk/python/ + @touch $@ +.make/build_python: .make/generate_python cd sdk/python/ && \ - printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - cp ../../README.md . && \ rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ rm ./bin/go.mod && \ python3 -m venv venv && \ ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . + @touch $@ .PHONY: clean clean: @@ -251,7 +254,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 3da395d9b..1dcf03a30 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -107,21 +107,24 @@ build_nodejs: .make/build_nodejs cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ -build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: .make/upstream - rm -rf sdk/python/ - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.PHONY: generate_python build_python +generate_python: .make/generate_python +build_python: .make/build_python +.make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_python: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod + cp README.md sdk/python/ + @touch $@ +.make/build_python: .make/generate_python cd sdk/python/ && \ - printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - cp ../../README.md . && \ rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ rm ./bin/go.mod && \ python3 -m venv venv && \ ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . + @touch $@ # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root .PHONY: build_registry_docs build_registry_docs: .make/build_registry_docs @@ -247,7 +250,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 88cb1586f..1659fab8d 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -107,21 +107,24 @@ build_nodejs: .make/build_nodejs cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ -build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_python: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_python: .make/upstream - rm -rf sdk/python/ - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.PHONY: generate_python build_python +generate_python: .make/generate_python +build_python: .make/build_python +.make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_python: bin/$(TFGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod + cp README.md sdk/python/ + @touch $@ +.make/build_python: .make/generate_python cd sdk/python/ && \ - printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ - cp ../../README.md . && \ rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ rm ./bin/go.mod && \ python3 -m venv venv && \ ./venv/bin/python -m pip install build==1.2.1 && \ cd ./bin && \ ../venv/bin/python -m build . + @touch $@ # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root .PHONY: build_registry_docs build_registry_docs: .make/build_registry_docs @@ -250,7 +253,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java build_python install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From a535867f2496710d0e8cfaf5f1f43312ef03c48a Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:12:28 +0000 Subject: [PATCH 17/29] Add sentinel targets for generate_java and build_java --- .../pkg/templates/bridged-provider/Makefile | 21 ++++++++++++------- provider-ci/test-providers/acme/Makefile | 21 ++++++++++++------- provider-ci/test-providers/aws/Makefile | 21 ++++++++++++------- .../test-providers/cloudflare/Makefile | 21 ++++++++++++------- provider-ci/test-providers/docker/Makefile | 21 ++++++++++++------- 5 files changed, 65 insertions(+), 40 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 302ca0332..d7d54dfcf 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -97,16 +97,21 @@ build_go: .make/build_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ -build_java: PACKAGE_VERSION := $(VERSION_GENERIC) -build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen .make/upstream - $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus +.PHONY: generate_java build_java +generate_java: .make/generate_java +build_java: .make/build_java +.make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/generate_java: bin/pulumi-java-gen .make/schema + PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus + printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/java/go.mod + @touch $@ +.make/build_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/build_java: .make/generate_java cd sdk/java/ && \ - printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ gradle --console=plain build && \ gradle --console=plain javadoc + @touch $@ .PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs @@ -282,7 +287,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 1573ba9d9..0790ee49e 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -81,16 +81,21 @@ build_go: .make/build_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ -build_java: PACKAGE_VERSION := $(VERSION_GENERIC) -build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen .make/upstream - $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus +.PHONY: generate_java build_java +generate_java: .make/generate_java +build_java: .make/build_java +.make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/generate_java: bin/pulumi-java-gen .make/schema + PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus + printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/java/go.mod + @touch $@ +.make/build_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/build_java: .make/generate_java cd sdk/java/ && \ - printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ gradle --console=plain build && \ gradle --console=plain javadoc + @touch $@ .PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs @@ -240,7 +245,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index d26dab170..57ca2f7cc 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -81,16 +81,21 @@ build_go: .make/build_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ -build_java: PACKAGE_VERSION := $(VERSION_GENERIC) -build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen .make/upstream - $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus +.PHONY: generate_java build_java +generate_java: .make/generate_java +build_java: .make/build_java +.make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/generate_java: bin/pulumi-java-gen .make/schema + PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus + printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/java/go.mod + @touch $@ +.make/build_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/build_java: .make/generate_java cd sdk/java/ && \ - printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ gradle --console=plain build && \ gradle --console=plain javadoc + @touch $@ .PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs @@ -254,7 +259,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 1dcf03a30..8dc057d6f 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -81,16 +81,21 @@ build_go: .make/build_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ -build_java: PACKAGE_VERSION := $(VERSION_GENERIC) -build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen .make/upstream - $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus +.PHONY: generate_java build_java +generate_java: .make/generate_java +build_java: .make/build_java +.make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/generate_java: bin/pulumi-java-gen .make/schema + PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus + printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/java/go.mod + @touch $@ +.make/build_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/build_java: .make/generate_java cd sdk/java/ && \ - printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ gradle --console=plain build && \ gradle --console=plain javadoc + @touch $@ .PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs @@ -250,7 +255,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 1659fab8d..0ce30c64e 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -81,16 +81,21 @@ build_go: .make/build_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ -build_java: PACKAGE_VERSION := $(VERSION_GENERIC) -build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -build_java: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache -build_java: bin/pulumi-java-gen .make/upstream - $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus +.PHONY: generate_java build_java +generate_java: .make/generate_java +build_java: .make/build_java +.make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +.make/generate_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/generate_java: bin/pulumi-java-gen .make/schema + PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus + printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/java/go.mod + @touch $@ +.make/build_java: PACKAGE_VERSION := $(VERSION_GENERIC) +.make/build_java: .make/generate_java cd sdk/java/ && \ - printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ gradle --console=plain build && \ gradle --console=plain javadoc + @touch $@ .PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs @@ -253,7 +258,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_java install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 0546735df454de09dcf3a117d032c40cfa01bc53 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:28:21 +0000 Subject: [PATCH 18/29] Tidy up top-level phony build targets - Auto-generate generate and install_sdks aliases from supported languages. --- .../pkg/templates/bridged-provider/Makefile | 19 +++++++++---------- provider-ci/test-providers/acme/Makefile | 19 +++++++++---------- provider-ci/test-providers/aws/Makefile | 19 +++++++++---------- .../test-providers/cloudflare/Makefile | 19 +++++++++---------- provider-ci/test-providers/docker/Makefile | 19 +++++++++---------- 5 files changed, 45 insertions(+), 50 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index d7d54dfcf..5b3da054a 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -52,11 +52,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -development: .make/install_plugins provider build_sdks install_sdks - -build: .make/install_plugins provider build_sdks install_sdks - -build_sdks: #{{ range .Config.Languages }}#build_#{{ . }}# #{{ end }}##{{- if .Config.RegistryDocs }}#.make/build_registry_docs#{{- end }}# +.PHONY: development only_build build generate_sdks build_sdks install_sdks +# Keep aliases for old targets to ensure backwards compatibility +development: build +only_build: build +build: install_plugins provider build_sdks install_sdks +generate_sdks:#{{ range .Config.Languages }}# generate_#{{ . }}##{{ end }}# +build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}##{{- if .Config.RegistryDocs }}#.make/build_registry_docs#{{- end }}# +install_sdks:#{{ range .Config.Languages }}# install_#{{ . }}#_sdk#{{ end }}# install_go_sdk: @@ -64,10 +67,6 @@ install_java_sdk: install_python_sdk: -install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk - -only_build: build - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -287,7 +286,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 0790ee49e..dd2a202dd 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -development: .make/install_plugins provider build_sdks install_sdks - -build: .make/install_plugins provider build_sdks install_sdks - -build_sdks: build_dotnet build_go build_nodejs build_python +.PHONY: development only_build build generate_sdks build_sdks install_sdks +# Keep aliases for old targets to ensure backwards compatibility +development: build +only_build: build +build: install_plugins provider build_sdks install_sdks +generate_sdks: generate_dotnet generate_go generate_nodejs generate_python +build_sdks: build_dotnet build_go build_nodejs build_python +install_sdks: install_dotnet_sdk install_go_sdk install_nodejs_sdk install_python_sdk install_go_sdk: @@ -48,10 +51,6 @@ install_java_sdk: install_python_sdk: -install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk - -only_build: build - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -245,7 +244,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 57ca2f7cc..b7f8d6f23 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -development: .make/install_plugins provider build_sdks install_sdks - -build: .make/install_plugins provider build_sdks install_sdks - -build_sdks: build_nodejs build_python build_dotnet build_go build_java +.PHONY: development only_build build generate_sdks build_sdks install_sdks +# Keep aliases for old targets to ensure backwards compatibility +development: build +only_build: build +build: install_plugins provider build_sdks install_sdks +generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java +build_sdks: build_nodejs build_python build_dotnet build_go build_java +install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk install_go_sdk: @@ -48,10 +51,6 @@ install_java_sdk: install_python_sdk: -install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk - -only_build: build - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -259,7 +258,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 8dc057d6f..84ec43ad1 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -development: .make/install_plugins provider build_sdks install_sdks - -build: .make/install_plugins provider build_sdks install_sdks - -build_sdks: build_nodejs build_python build_dotnet build_go build_java .make/build_registry_docs +.PHONY: development only_build build generate_sdks build_sdks install_sdks +# Keep aliases for old targets to ensure backwards compatibility +development: build +only_build: build +build: install_plugins provider build_sdks install_sdks +generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java +build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs +install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk install_go_sdk: @@ -48,10 +51,6 @@ install_java_sdk: install_python_sdk: -install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk - -only_build: build - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -255,7 +254,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 0ce30c64e..b85967810 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -development: .make/install_plugins provider build_sdks install_sdks - -build: .make/install_plugins provider build_sdks install_sdks - -build_sdks: build_nodejs build_python build_dotnet build_go build_java .make/build_registry_docs +.PHONY: development only_build build generate_sdks build_sdks install_sdks +# Keep aliases for old targets to ensure backwards compatibility +development: build +only_build: build +build: install_plugins provider build_sdks install_sdks +generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java +build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs +install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk install_go_sdk: @@ -48,10 +51,6 @@ install_java_sdk: install_python_sdk: -install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk - -only_build: build - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -258,7 +257,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build install_dotnet_sdk install_nodejs_sdk lint_provider provider provider_no_deps test ci-mgmt test_provider debug_tfgen +.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From 9447f73072dc56b2bff84f86e4dffaaa87f6cc7a Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:33:23 +0000 Subject: [PATCH 19/29] Add sentinel targets for install_*_sdk targets - Group all install_*_sdk targets together after the build_* targets. --- .../pkg/templates/bridged-provider/Makefile | 21 ++++++++++--------- provider-ci/test-providers/acme/Makefile | 21 ++++++++++--------- provider-ci/test-providers/aws/Makefile | 21 ++++++++++--------- .../test-providers/cloudflare/Makefile | 21 ++++++++++--------- provider-ci/test-providers/docker/Makefile | 21 ++++++++++--------- 5 files changed, 55 insertions(+), 50 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 5b3da054a..45be8a7e4 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -61,12 +61,6 @@ generate_sdks:#{{ range .Config.Languages }}# generate_#{{ . }}##{{ end }}# build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}##{{- if .Config.RegistryDocs }}#.make/build_registry_docs#{{- end }}# install_sdks:#{{ range .Config.Languages }}# install_#{{ . }}#_sdk#{{ end }}# -install_go_sdk: - -install_java_sdk: - -install_python_sdk: - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -169,12 +163,19 @@ docs: .make/docs @touch $@ #{{- end }}# -install_dotnet_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +install_dotnet_sdk: .make/install_dotnet_sdk +.make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; - -install_nodejs_sdk: + @touch $@ +install_go_sdk: +install_java_sdk: +install_nodejs_sdk: .make/install_nodejs_sdk +.make/install_nodejs_sdk: .make/build_nodejs yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin + @touch $@ +install_python_sdk: .PHONY: install_plugins install_plugins: .make/install_plugins @@ -286,7 +287,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index dd2a202dd..1e89f3b4e 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -45,12 +45,6 @@ generate_sdks: generate_dotnet generate_go generate_nodejs generate_python build_sdks: build_dotnet build_go build_nodejs build_python install_sdks: install_dotnet_sdk install_go_sdk install_nodejs_sdk install_python_sdk -install_go_sdk: - -install_java_sdk: - -install_python_sdk: - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -136,12 +130,19 @@ clean: rm -rf bin/* rm -rf .make/* -install_dotnet_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +install_dotnet_sdk: .make/install_dotnet_sdk +.make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; - -install_nodejs_sdk: + @touch $@ +install_go_sdk: +install_java_sdk: +install_nodejs_sdk: .make/install_nodejs_sdk +.make/install_nodejs_sdk: .make/build_nodejs yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin + @touch $@ +install_python_sdk: .PHONY: install_plugins install_plugins: .make/install_plugins @@ -244,7 +245,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index b7f8d6f23..21c606d8a 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -45,12 +45,6 @@ generate_sdks: generate_nodejs generate_python generate_dotnet generate_go gener build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk -install_go_sdk: - -install_java_sdk: - -install_python_sdk: - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -136,12 +130,19 @@ clean: rm -rf bin/* rm -rf .make/* -install_dotnet_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +install_dotnet_sdk: .make/install_dotnet_sdk +.make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; - -install_nodejs_sdk: + @touch $@ +install_go_sdk: +install_java_sdk: +install_nodejs_sdk: .make/install_nodejs_sdk +.make/install_nodejs_sdk: .make/build_nodejs yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin + @touch $@ +install_python_sdk: .PHONY: install_plugins install_plugins: .make/install_plugins @@ -258,7 +259,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 84ec43ad1..ea45c29e0 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -45,12 +45,6 @@ generate_sdks: generate_nodejs generate_python generate_dotnet generate_go gener build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk -install_go_sdk: - -install_java_sdk: - -install_python_sdk: - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -142,12 +136,19 @@ clean: rm -rf bin/* rm -rf .make/* -install_dotnet_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +install_dotnet_sdk: .make/install_dotnet_sdk +.make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; - -install_nodejs_sdk: + @touch $@ +install_go_sdk: +install_java_sdk: +install_nodejs_sdk: .make/install_nodejs_sdk +.make/install_nodejs_sdk: .make/build_nodejs yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin + @touch $@ +install_python_sdk: .PHONY: install_plugins install_plugins: .make/install_plugins @@ -254,7 +255,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index b85967810..c44cb0e5d 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -45,12 +45,6 @@ generate_sdks: generate_nodejs generate_python generate_dotnet generate_go gener build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk -install_go_sdk: - -install_java_sdk: - -install_python_sdk: - GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) @@ -147,12 +141,19 @@ docs: .make/docs cd provider/pkg/docs-gen/examples/ && go run generate.go ./yaml ./ @touch $@ -install_dotnet_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +install_dotnet_sdk: .make/install_dotnet_sdk +.make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; - -install_nodejs_sdk: + @touch $@ +install_go_sdk: +install_java_sdk: +install_nodejs_sdk: .make/install_nodejs_sdk +.make/install_nodejs_sdk: .make/build_nodejs yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin + @touch $@ +install_python_sdk: .PHONY: install_plugins install_plugins: .make/install_plugins @@ -257,7 +258,7 @@ ci-mgmt: .ci-mgmt.yaml debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) -.PHONY: install_go_sdk install_java_sdk install_python_sdk install_sdks install_dotnet_sdk install_nodejs_sdk lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen # Provider cross-platform build & packaging From eb48e3794d860e6481a2545c74c523384ef9ef27 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:38:14 +0000 Subject: [PATCH 20/29] Tidy up remaining phony targets - Move .PHONY declaration next to the target definition. --- .../internal/pkg/templates/bridged-provider/Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 45be8a7e4..d55368d34 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -189,11 +189,11 @@ install_plugins: .make/install_plugins lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml - # `lint_provider.fix` is a utility target meant to be run manually # that will run the linter and fix errors when possible. lint_provider.fix: cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml --fix +.PHONY: lint_provider lint_provider.fix # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-#{{ .Config.Provider }}#/schema.json` is valid and up to date. @@ -209,12 +209,11 @@ bin/$(PROVIDER): .make/schema test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h +.PHONY: test test_provider: - @echo "" - @echo "== test_provider ===================================================================" - @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: test_provider .PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema @@ -263,6 +262,7 @@ bin/pulumi-java-gen: .pulumi-java-gen.version # ci-mgmt: .ci-mgmt.yaml go run github.com/pulumi/ci-mgmt/provider-ci@master generate +.PHONY: ci-mgmt # Because some codegen depends on the version of the CLI used, we install a local CLI # version pinned to the same version as `provider/go.mod`. @@ -286,8 +286,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) - -.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: debug_tfgen # Provider cross-platform build & packaging From f673197b5de377a9d9989a65892e8ce0402b69a6 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:42:32 +0000 Subject: [PATCH 21/29] Move phony statements to end of blocks Let's keep this consistent and make it not the first thing you read in each block. --- .../pkg/templates/bridged-provider/Makefile | 31 +++++++------- provider-ci/test-providers/acme/Makefile | 38 ++++++++--------- provider-ci/test-providers/aws/Makefile | 38 ++++++++--------- .../test-providers/cloudflare/Makefile | 40 ++++++++---------- provider-ci/test-providers/docker/Makefile | 42 +++++++++---------- 5 files changed, 85 insertions(+), 104 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index d55368d34..fa7a6c383 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -52,7 +52,6 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -.PHONY: development only_build build generate_sdks build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build @@ -60,12 +59,12 @@ build: install_plugins provider build_sdks install_sdks generate_sdks:#{{ range .Config.Languages }}# generate_#{{ . }}##{{ end }}# build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}##{{- if .Config.RegistryDocs }}#.make/build_registry_docs#{{- end }}# install_sdks:#{{ range .Config.Languages }}# install_#{{ . }}#_sdk#{{ end }}# +.PHONY: development only_build build generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) -.PHONY: generate_dotnet build_dotnet generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -78,8 +77,8 @@ build_dotnet: .make/build_dotnet .make/build_dotnet: .make/generate_dotnet cd sdk/dotnet/ && dotnet build @touch $@ +.PHONY: generate_dotnet build_dotnet -.PHONY: generate_go build_go generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -89,8 +88,8 @@ build_go: .make/build_go .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ +.PHONY: generate_go build_go -.PHONY: generate_java build_java generate_java: .make/generate_java build_java: .make/build_java .make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -105,8 +104,8 @@ build_java: .make/build_java gradle --console=plain build && \ gradle --console=plain javadoc @touch $@ +.PHONY: generate_java build_java -.PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -120,8 +119,8 @@ build_nodejs: .make/build_nodejs yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ +.PHONY: generate_nodejs build_nodejs -.PHONY: generate_python build_python generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -139,31 +138,31 @@ build_python: .make/build_python cd ./bin && \ ../venv/bin/python -m build . @touch $@ +.PHONY: generate_python build_python #{{- if .Config.RegistryDocs }}# # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root -.PHONY: build_registry_docs build_registry_docs: .make/build_registry_docs .make/build_registry_docs: bin/$(TFGEN) bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs @touch $@ +.PHONY: build_registry_docs #{{- end }}# -.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* +.PHONY: clean #{{- if .Config.DocsCmd }}# -.PHONY: docs docs: .make/docs .make/docs: #{{ .Config.DocsCmd }}# @touch $@ +.PHONY: docs #{{- end }}# -.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget @@ -176,8 +175,8 @@ install_nodejs_sdk: .make/install_nodejs_sdk yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin @touch $@ install_python_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -.PHONY: install_plugins install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -186,6 +185,7 @@ install_plugins: .make/install_plugins .pulumi/bin/pulumi plugin install #{{ or .Kind "resource" }}# #{{ .Name }}# #{{ .Version }}# #{{- end }}# @touch $@ +.PHONY: install_plugins lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml @@ -198,13 +198,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-#{{ .Config.Provider }}#/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. -.PHONY: provider provider_no_deps build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) provider: bin/$(PROVIDER) provider_no_deps: $(call build_provider_cmd) bin/$(PROVIDER): .make/schema $(call build_provider_cmd) +.PHONY: provider provider_no_deps test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: @@ -215,12 +215,10 @@ test_provider: cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) .PHONY: test_provider -.PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema schema: .make/schema #{{ if .Config.DocsCmd }}# .make/docs#{{ end }}# # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema - .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) @@ -231,13 +229,11 @@ tfgen_no_deps: .make/schema $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ - tfgen_build_only: bin/$(TFGEN) - bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only -.PHONY: upstream upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) @@ -251,6 +247,7 @@ endif cd upstream-tools && yarn --silent run apply #{{- end }}# @touch $@ +.PHONY: upstream bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 1e89f3b4e..5e23aab65 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -36,7 +36,6 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -.PHONY: development only_build build generate_sdks build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build @@ -44,12 +43,12 @@ build: install_plugins provider build_sdks install_sdks generate_sdks: generate_dotnet generate_go generate_nodejs generate_python build_sdks: build_dotnet build_go build_nodejs build_python install_sdks: install_dotnet_sdk install_go_sdk install_nodejs_sdk install_python_sdk +.PHONY: development only_build build generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) -.PHONY: generate_dotnet build_dotnet generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -62,8 +61,8 @@ build_dotnet: .make/build_dotnet .make/build_dotnet: .make/generate_dotnet cd sdk/dotnet/ && dotnet build @touch $@ +.PHONY: generate_dotnet build_dotnet -.PHONY: generate_go build_go generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -73,8 +72,8 @@ build_go: .make/build_go .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ +.PHONY: generate_go build_go -.PHONY: generate_java build_java generate_java: .make/generate_java build_java: .make/build_java .make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -89,8 +88,8 @@ build_java: .make/build_java gradle --console=plain build && \ gradle --console=plain javadoc @touch $@ +.PHONY: generate_java build_java -.PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -104,8 +103,8 @@ build_nodejs: .make/build_nodejs yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ +.PHONY: generate_nodejs build_nodejs -.PHONY: generate_python build_python generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -123,14 +122,14 @@ build_python: .make/build_python cd ./bin && \ ../venv/bin/python -m build . @touch $@ +.PHONY: generate_python build_python -.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* +.PHONY: clean -.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget @@ -143,49 +142,47 @@ install_nodejs_sdk: .make/install_nodejs_sdk yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin @touch $@ install_python_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -.PHONY: install_plugins install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/install_plugins: .pulumi/bin/pulumi @touch $@ +.PHONY: install_plugins lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml - # `lint_provider.fix` is a utility target meant to be run manually # that will run the linter and fix errors when possible. lint_provider.fix: cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml --fix +.PHONY: lint_provider lint_provider.fix # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-acme/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. -.PHONY: provider provider_no_deps build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) provider: bin/$(PROVIDER) provider_no_deps: $(call build_provider_cmd) bin/$(PROVIDER): .make/schema $(call build_provider_cmd) +.PHONY: provider provider_no_deps test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h +.PHONY: test test_provider: - @echo "" - @echo "== test_provider ===================================================================" - @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: test_provider -.PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema schema: .make/schema # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema - .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) @@ -196,13 +193,11 @@ tfgen_no_deps: .make/schema $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ - tfgen_build_only: bin/$(TFGEN) - bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only -.PHONY: upstream upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) @@ -210,6 +205,7 @@ ifneq ("$(wildcard upstream)","") ./upstream.sh init endif @touch $@ +.PHONY: upstream bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -221,6 +217,7 @@ bin/pulumi-java-gen: .pulumi-java-gen.version # ci-mgmt: .ci-mgmt.yaml go run github.com/pulumi/ci-mgmt/provider-ci@master generate +.PHONY: ci-mgmt # Because some codegen depends on the version of the CLI used, we install a local CLI # version pinned to the same version as `provider/go.mod`. @@ -244,8 +241,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) - -.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 21c606d8a..9ad42726c 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -36,7 +36,6 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -.PHONY: development only_build build generate_sdks build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build @@ -44,12 +43,12 @@ build: install_plugins provider build_sdks install_sdks generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk +.PHONY: development only_build build generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) -.PHONY: generate_dotnet build_dotnet generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -62,8 +61,8 @@ build_dotnet: .make/build_dotnet .make/build_dotnet: .make/generate_dotnet cd sdk/dotnet/ && dotnet build @touch $@ +.PHONY: generate_dotnet build_dotnet -.PHONY: generate_go build_go generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -73,8 +72,8 @@ build_go: .make/build_go .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ +.PHONY: generate_go build_go -.PHONY: generate_java build_java generate_java: .make/generate_java build_java: .make/build_java .make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -89,8 +88,8 @@ build_java: .make/build_java gradle --console=plain build && \ gradle --console=plain javadoc @touch $@ +.PHONY: generate_java build_java -.PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -104,8 +103,8 @@ build_nodejs: .make/build_nodejs yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ +.PHONY: generate_nodejs build_nodejs -.PHONY: generate_python build_python generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -123,14 +122,14 @@ build_python: .make/build_python cd ./bin && \ ../venv/bin/python -m build . @touch $@ +.PHONY: generate_python build_python -.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* +.PHONY: clean -.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget @@ -143,8 +142,8 @@ install_nodejs_sdk: .make/install_nodejs_sdk yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin @touch $@ install_python_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -.PHONY: install_plugins install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -160,42 +159,40 @@ install_plugins: .make/install_plugins .pulumi/bin/pulumi plugin install resource std 1.6.2 .pulumi/bin/pulumi plugin install converter terraform 1.0.17 @touch $@ +.PHONY: install_plugins lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml - # `lint_provider.fix` is a utility target meant to be run manually # that will run the linter and fix errors when possible. lint_provider.fix: cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml --fix +.PHONY: lint_provider lint_provider.fix # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-aws/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. -.PHONY: provider provider_no_deps build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) provider: bin/$(PROVIDER) provider_no_deps: $(call build_provider_cmd) bin/$(PROVIDER): .make/schema $(call build_provider_cmd) +.PHONY: provider provider_no_deps test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h +.PHONY: test test_provider: - @echo "" - @echo "== test_provider ===================================================================" - @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: test_provider -.PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema schema: .make/schema # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema - .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) @@ -206,13 +203,11 @@ tfgen_no_deps: .make/schema $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ - tfgen_build_only: bin/$(TFGEN) - bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only -.PHONY: upstream upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) @@ -224,6 +219,7 @@ endif # Apply all automated changes cd upstream-tools && yarn --silent run apply @touch $@ +.PHONY: upstream bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -235,6 +231,7 @@ bin/pulumi-java-gen: .pulumi-java-gen.version # ci-mgmt: .ci-mgmt.yaml go run github.com/pulumi/ci-mgmt/provider-ci@master generate +.PHONY: ci-mgmt # Because some codegen depends on the version of the CLI used, we install a local CLI # version pinned to the same version as `provider/go.mod`. @@ -258,8 +255,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) - -.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index ea45c29e0..f0687e640 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -36,7 +36,6 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -.PHONY: development only_build build generate_sdks build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build @@ -44,12 +43,12 @@ build: install_plugins provider build_sdks install_sdks generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk +.PHONY: development only_build build generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) -.PHONY: generate_dotnet build_dotnet generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -62,8 +61,8 @@ build_dotnet: .make/build_dotnet .make/build_dotnet: .make/generate_dotnet cd sdk/dotnet/ && dotnet build @touch $@ +.PHONY: generate_dotnet build_dotnet -.PHONY: generate_go build_go generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -73,8 +72,8 @@ build_go: .make/build_go .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ +.PHONY: generate_go build_go -.PHONY: generate_java build_java generate_java: .make/generate_java build_java: .make/build_java .make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -89,8 +88,8 @@ build_java: .make/build_java gradle --console=plain build && \ gradle --console=plain javadoc @touch $@ +.PHONY: generate_java build_java -.PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -104,8 +103,8 @@ build_nodejs: .make/build_nodejs yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ +.PHONY: generate_nodejs build_nodejs -.PHONY: generate_python build_python generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -123,20 +122,20 @@ build_python: .make/build_python cd ./bin && \ ../venv/bin/python -m build . @touch $@ +.PHONY: generate_python build_python # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root -.PHONY: build_registry_docs build_registry_docs: .make/build_registry_docs .make/build_registry_docs: bin/$(TFGEN) bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs @touch $@ +.PHONY: build_registry_docs -.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* +.PHONY: clean -.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget @@ -149,8 +148,8 @@ install_nodejs_sdk: .make/install_nodejs_sdk yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin @touch $@ install_python_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -.PHONY: install_plugins install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -160,42 +159,40 @@ install_plugins: .make/install_plugins .pulumi/bin/pulumi plugin install resource gcp 5.0.0 .pulumi/bin/pulumi plugin install resource tls 4.0.0 @touch $@ +.PHONY: install_plugins lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml - # `lint_provider.fix` is a utility target meant to be run manually # that will run the linter and fix errors when possible. lint_provider.fix: cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml --fix +.PHONY: lint_provider lint_provider.fix # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-cloudflare/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. -.PHONY: provider provider_no_deps build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) provider: bin/$(PROVIDER) provider_no_deps: $(call build_provider_cmd) bin/$(PROVIDER): .make/schema $(call build_provider_cmd) +.PHONY: provider provider_no_deps test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h +.PHONY: test test_provider: - @echo "" - @echo "== test_provider ===================================================================" - @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: test_provider -.PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema schema: .make/schema # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema - .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) @@ -206,13 +203,11 @@ tfgen_no_deps: .make/schema $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ - tfgen_build_only: bin/$(TFGEN) - bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only -.PHONY: upstream upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) @@ -220,6 +215,7 @@ ifneq ("$(wildcard upstream)","") ./upstream.sh init endif @touch $@ +.PHONY: upstream bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -231,6 +227,7 @@ bin/pulumi-java-gen: .pulumi-java-gen.version # ci-mgmt: .ci-mgmt.yaml go run github.com/pulumi/ci-mgmt/provider-ci@master generate +.PHONY: ci-mgmt # Because some codegen depends on the version of the CLI used, we install a local CLI # version pinned to the same version as `provider/go.mod`. @@ -254,8 +251,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) - -.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index c44cb0e5d..04980e35a 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -36,7 +36,6 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) -.PHONY: development only_build build generate_sdks build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build @@ -44,12 +43,12 @@ build: install_plugins provider build_sdks install_sdks generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk +.PHONY: development only_build build generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) -.PHONY: generate_dotnet build_dotnet generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -62,8 +61,8 @@ build_dotnet: .make/build_dotnet .make/build_dotnet: .make/generate_dotnet cd sdk/dotnet/ && dotnet build @touch $@ +.PHONY: generate_dotnet build_dotnet -.PHONY: generate_go build_go generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -73,8 +72,8 @@ build_go: .make/build_go .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @touch $@ +.PHONY: generate_go build_go -.PHONY: generate_java build_java generate_java: .make/generate_java build_java: .make/build_java .make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -89,8 +88,8 @@ build_java: .make/build_java gradle --console=plain build && \ gradle --console=plain javadoc @touch $@ +.PHONY: generate_java build_java -.PHONY: generate_nodejs build_nodejs generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -104,8 +103,8 @@ build_nodejs: .make/build_nodejs yarn run tsc && \ cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ @touch $@ +.PHONY: generate_nodejs build_nodejs -.PHONY: generate_python build_python generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -123,25 +122,25 @@ build_python: .make/build_python cd ./bin && \ ../venv/bin/python -m build . @touch $@ +.PHONY: generate_python build_python # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root -.PHONY: build_registry_docs build_registry_docs: .make/build_registry_docs .make/build_registry_docs: bin/$(TFGEN) bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs @touch $@ +.PHONY: build_registry_docs -.PHONY: clean clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* -.PHONY: docs +.PHONY: clean docs: .make/docs .make/docs: cd provider/pkg/docs-gen/examples/ && go run generate.go ./yaml ./ @touch $@ +.PHONY: docs -.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet mkdir -p $(WORKING_DIR)/nuget @@ -154,8 +153,8 @@ install_nodejs_sdk: .make/install_nodejs_sdk yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin @touch $@ install_python_sdk: +.PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -.PHONY: install_plugins install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -163,42 +162,40 @@ install_plugins: .make/install_plugins .pulumi/bin/pulumi plugin install converter terraform 1.0.16 .pulumi/bin/pulumi plugin install resource aws 6.8.0 @touch $@ +.PHONY: install_plugins lint_provider: provider cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml - # `lint_provider.fix` is a utility target meant to be run manually # that will run the linter and fix errors when possible. lint_provider.fix: cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml --fix +.PHONY: lint_provider lint_provider.fix # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-docker/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. -.PHONY: provider provider_no_deps build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) provider: bin/$(PROVIDER) provider_no_deps: $(call build_provider_cmd) bin/$(PROVIDER): .make/schema $(call build_provider_cmd) +.PHONY: provider provider_no_deps test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h +.PHONY: test test_provider: - @echo "" - @echo "== test_provider ===================================================================" - @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +.PHONY: test_provider -.PHONY: tfgen schema tfgen_no_deps tfgen_build_only tfgen: schema schema: .make/schema .make/docs # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema - .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) @@ -209,13 +206,11 @@ tfgen_no_deps: .make/schema $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ - tfgen_build_only: bin/$(TFGEN) - bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +.PHONY: tfgen schema tfgen_no_deps tfgen_build_only -.PHONY: upstream upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) @@ -223,6 +218,7 @@ ifneq ("$(wildcard upstream)","") ./upstream.sh init endif @touch $@ +.PHONY: upstream bin/pulumi-java-gen: .pulumi-java-gen.version pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java @@ -234,6 +230,7 @@ bin/pulumi-java-gen: .pulumi-java-gen.version # ci-mgmt: .ci-mgmt.yaml go run github.com/pulumi/ci-mgmt/provider-ci@master generate +.PHONY: ci-mgmt # Because some codegen depends on the version of the CLI used, we install a local CLI # version pinned to the same version as `provider/go.mod`. @@ -257,8 +254,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) - -.PHONY: lint_provider test ci-mgmt test_provider debug_tfgen +.PHONY: debug_tfgen # Provider cross-platform build & packaging From 915884a135e777f4b54e0c88b3f43f62bd01e2a8 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 12:46:09 +0000 Subject: [PATCH 22/29] Add new `make generate` alias - This gets the repo into a state ready to be committed without having to wait on any build steps. - Include the schema and docs in the "generate" target. - Add some inline documentation for the most popular targets. - Fix build_sdk target to depend on the alias for build_registry_docs rather than the sentinel file. --- .../internal/pkg/templates/bridged-provider/Makefile | 7 +++++-- provider-ci/test-providers/acme/Makefile | 5 ++++- provider-ci/test-providers/aws/Makefile | 5 ++++- provider-ci/test-providers/cloudflare/Makefile | 7 +++++-- provider-ci/test-providers/docker/Makefile | 7 +++++-- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index fa7a6c383..a0eb38e32 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -55,11 +55,14 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build +# Build the provider and all SDKs and install ready for testing build: install_plugins provider build_sdks install_sdks +# Creates all generated files which need to be committed +generate: generate_sdks schema#{{- if .Config.RegistryDocs }}# build_registry_docs#{{- end }}# generate_sdks:#{{ range .Config.Languages }}# generate_#{{ . }}##{{ end }}# -build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}##{{- if .Config.RegistryDocs }}#.make/build_registry_docs#{{- end }}# +build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}##{{- if .Config.RegistryDocs }}#build_registry_docs#{{- end }}# install_sdks:#{{ range .Config.Languages }}# install_#{{ . }}#_sdk#{{ end }}# -.PHONY: development only_build build generate_sdks build_sdks install_sdks +.PHONY: development only_build build generate generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 5e23aab65..1656d4598 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -39,11 +39,14 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build +# Build the provider and all SDKs and install ready for testing build: install_plugins provider build_sdks install_sdks +# Creates all generated files which need to be committed +generate: generate_sdks schema generate_sdks: generate_dotnet generate_go generate_nodejs generate_python build_sdks: build_dotnet build_go build_nodejs build_python install_sdks: install_dotnet_sdk install_go_sdk install_nodejs_sdk install_python_sdk -.PHONY: development only_build build generate_sdks build_sdks install_sdks +.PHONY: development only_build build generate generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 9ad42726c..1d4a52307 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -39,11 +39,14 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build +# Build the provider and all SDKs and install ready for testing build: install_plugins provider build_sdks install_sdks +# Creates all generated files which need to be committed +generate: generate_sdks schema generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk -.PHONY: development only_build build generate_sdks build_sdks install_sdks +.PHONY: development only_build build generate generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index f0687e640..ec07c11cd 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -39,11 +39,14 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build +# Build the provider and all SDKs and install ready for testing build: install_plugins provider build_sdks install_sdks +# Creates all generated files which need to be committed +generate: generate_sdks schema build_registry_docs generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java -build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs +build_sdks: build_nodejs build_python build_dotnet build_go build_javabuild_registry_docs install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk -.PHONY: development only_build build generate_sdks build_sdks install_sdks +.PHONY: development only_build build generate generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 04980e35a..d1f9992f6 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -39,11 +39,14 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build +# Build the provider and all SDKs and install ready for testing build: install_plugins provider build_sdks install_sdks +# Creates all generated files which need to be committed +generate: generate_sdks schema build_registry_docs generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java -build_sdks: build_nodejs build_python build_dotnet build_go build_java.make/build_registry_docs +build_sdks: build_nodejs build_python build_dotnet build_go build_javabuild_registry_docs install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk -.PHONY: development only_build build generate_sdks build_sdks install_sdks +.PHONY: development only_build build generate generate_sdks build_sdks install_sdks GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache From 13fbe34edaf411e3265eeb26edba03116c9965aa Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 14:07:01 +0000 Subject: [PATCH 23/29] Mark SDK as up-to-date after downloading, before testing --- .../pkg/templates/bridged-provider/.github/workflows/main.yml | 2 ++ .../bridged-provider/.github/workflows/nightly-test.yml | 2 ++ .../templates/bridged-provider/.github/workflows/prerelease.yml | 2 ++ .../templates/bridged-provider/.github/workflows/release.yml | 2 ++ .../bridged-provider/.github/workflows/run-acceptance-tests.yml | 2 ++ provider-ci/test-providers/acme/.github/workflows/main.yml | 2 ++ .../test-providers/acme/.github/workflows/prerelease.yml | 2 ++ provider-ci/test-providers/acme/.github/workflows/release.yml | 2 ++ .../acme/.github/workflows/run-acceptance-tests.yml | 2 ++ provider-ci/test-providers/aws/.github/workflows/master.yml | 2 ++ .../test-providers/aws/.github/workflows/nightly-test.yml | 2 ++ provider-ci/test-providers/aws/.github/workflows/prerelease.yml | 2 ++ provider-ci/test-providers/aws/.github/workflows/release.yml | 2 ++ .../aws/.github/workflows/run-acceptance-tests.yml | 2 ++ .../test-providers/cloudflare/.github/workflows/master.yml | 2 ++ .../test-providers/cloudflare/.github/workflows/prerelease.yml | 2 ++ .../test-providers/cloudflare/.github/workflows/release.yml | 2 ++ .../cloudflare/.github/workflows/run-acceptance-tests.yml | 2 ++ provider-ci/test-providers/docker/.github/workflows/master.yml | 2 ++ .../test-providers/docker/.github/workflows/prerelease.yml | 2 ++ provider-ci/test-providers/docker/.github/workflows/release.yml | 2 ++ .../docker/.github/workflows/run-acceptance-tests.yml | 2 ++ 22 files changed, 44 insertions(+) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml index 4955fc311..ac6c1455e 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml @@ -159,6 +159,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml index 8089b6ae6..e7f68cb51 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml @@ -68,6 +68,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml index 121807a5c..2b5d83496 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml @@ -98,6 +98,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml index 86c1d6043..c97834f27 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml @@ -107,6 +107,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index c91b87ea7..ce213ae8b 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -155,6 +155,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/main.yml b/provider-ci/test-providers/acme/.github/workflows/main.yml index e51fb11e0..3db43936e 100644 --- a/provider-ci/test-providers/acme/.github/workflows/main.yml +++ b/provider-ci/test-providers/acme/.github/workflows/main.yml @@ -153,6 +153,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml index 07a7a7cec..f1728eb75 100644 --- a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml @@ -95,6 +95,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/release.yml b/provider-ci/test-providers/acme/.github/workflows/release.yml index 173db15fc..b42a62907 100644 --- a/provider-ci/test-providers/acme/.github/workflows/release.yml +++ b/provider-ci/test-providers/acme/.github/workflows/release.yml @@ -101,6 +101,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml index 8a5f45d73..ecfc3c8a3 100644 --- a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml @@ -150,6 +150,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index b80eadf4a..35fbfc527 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -165,6 +165,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml index 93d71620a..4f12be75f 100644 --- a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml @@ -81,6 +81,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml index c4d43286e..2ddb3f806 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -106,6 +106,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index fa6d7d0f3..aae272b83 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -112,6 +112,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml index 02d8dd92e..a52506dea 100644 --- a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml @@ -158,6 +158,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index b38cc00ed..fd1e54902 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -155,6 +155,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml index 79db1ce27..bd7984553 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -97,6 +97,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index a3d7103ae..b1c592075 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -103,6 +103,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml index 897ed8b81..186910c6a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml @@ -152,6 +152,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/master.yml b/provider-ci/test-providers/docker/.github/workflows/master.yml index ef631a5bd..f38ba58cb 100644 --- a/provider-ci/test-providers/docker/.github/workflows/master.yml +++ b/provider-ci/test-providers/docker/.github/workflows/master.yml @@ -168,6 +168,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml index 647517823..2ef0a0a60 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml @@ -110,6 +110,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/release.yml b/provider-ci/test-providers/docker/.github/workflows/release.yml index cc3f8ca8f..128a141a2 100644 --- a/provider-ci/test-providers/docker/.github/workflows/release.yml +++ b/provider-ci/test-providers/docker/.github/workflows/release.yml @@ -116,6 +116,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml index f8241233c..ef71bbba5 100644 --- a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml @@ -165,6 +165,8 @@ jobs: uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} + - name: Mark SDK up to date + run: make --touch build_${{ matrix.language }} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps From 84396bb3d6d5e5982ae7ecb1ad0b736d73e2706c Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 14:20:04 +0000 Subject: [PATCH 24/29] Handle nuget setup in makefile This allows users to more easily set up their local test environment to run dotnet tests as well as removing special logic in CI. - Remove special dotnet step in test jobs. - Add nuget entry via `install_dotnet_sdk` target. - Check if it already exists to avoid dotnet error. - Remove nuget source on running clean if it's found. --- .../bridged-provider/.github/workflows/main.yml | 3 --- .../.github/workflows/nightly-test.yml | 3 --- .../bridged-provider/.github/workflows/prerelease.yml | 3 --- .../bridged-provider/.github/workflows/release.yml | 3 --- .../.github/workflows/run-acceptance-tests.yml | 3 --- .../internal/pkg/templates/bridged-provider/Makefile | 10 ++++++++-- .../test-providers/acme/.github/workflows/main.yml | 3 --- .../acme/.github/workflows/prerelease.yml | 3 --- .../test-providers/acme/.github/workflows/release.yml | 3 --- .../acme/.github/workflows/run-acceptance-tests.yml | 3 --- provider-ci/test-providers/acme/Makefile | 10 ++++++++-- .../test-providers/aws/.github/workflows/master.yml | 3 --- .../aws/.github/workflows/nightly-test.yml | 3 --- .../aws/.github/workflows/prerelease.yml | 3 --- .../test-providers/aws/.github/workflows/release.yml | 3 --- .../aws/.github/workflows/run-acceptance-tests.yml | 3 --- provider-ci/test-providers/aws/Makefile | 10 ++++++++-- .../cloudflare/.github/workflows/master.yml | 3 --- .../cloudflare/.github/workflows/prerelease.yml | 3 --- .../cloudflare/.github/workflows/release.yml | 3 --- .../.github/workflows/run-acceptance-tests.yml | 3 --- provider-ci/test-providers/cloudflare/Makefile | 10 ++++++++-- .../test-providers/docker/.github/workflows/master.yml | 3 --- .../docker/.github/workflows/prerelease.yml | 3 --- .../docker/.github/workflows/release.yml | 3 --- .../docker/.github/workflows/run-acceptance-tests.yml | 3 --- provider-ci/test-providers/docker/Makefile | 10 ++++++++-- 27 files changed, 40 insertions(+), 76 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml index ac6c1455e..f96e2400d 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml @@ -152,9 +152,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml index e7f68cb51..e5e5f11c3 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml @@ -61,9 +61,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language}} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml index 2b5d83496..3d2af4ebe 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml @@ -91,9 +91,6 @@ jobs: tools: pulumictl, pulumicli, #{{ range $index, $element := .Config.Languages }}##{{if $index}}#, #{{end}}##{{ $element }}##{{end}}# - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml index c97834f27..1c9e3b8c0 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml @@ -100,9 +100,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index ce213ae8b..a3a1a18de 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -148,9 +148,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index a0eb38e32..3d847b928 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -156,6 +156,9 @@ clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* + if dotnet nuget list source | grep "$(WORKING_DIR)/nuget"; then \ + dotnet nuget remove source "$(WORKING_DIR)/nuget" \ + ; fi .PHONY: clean #{{- if .Config.DocsCmd }}# @@ -168,8 +171,11 @@ docs: .make/docs install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet - mkdir -p $(WORKING_DIR)/nuget - find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; + mkdir -p nuget + find sdk/dotnet/bin -name '*.nupkg' -print -exec cp -p "{}" ${WORKING_DIR}/nuget \; + if ! dotnet nuget list source | grep "${WORKING_DIR}/nuget"; then \ + dotnet nuget add source "${WORKING_DIR}/nuget" --name "${WORKING_DIR}/nuget" \ + ; fi @touch $@ install_go_sdk: install_java_sdk: diff --git a/provider-ci/test-providers/acme/.github/workflows/main.yml b/provider-ci/test-providers/acme/.github/workflows/main.yml index 3db43936e..d82f11213 100644 --- a/provider-ci/test-providers/acme/.github/workflows/main.yml +++ b/provider-ci/test-providers/acme/.github/workflows/main.yml @@ -146,9 +146,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml index f1728eb75..b70ade9b2 100644 --- a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml @@ -88,9 +88,6 @@ jobs: tools: pulumictl, pulumicli, dotnet, go, nodejs, python - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/acme/.github/workflows/release.yml b/provider-ci/test-providers/acme/.github/workflows/release.yml index b42a62907..f6d5d7696 100644 --- a/provider-ci/test-providers/acme/.github/workflows/release.yml +++ b/provider-ci/test-providers/acme/.github/workflows/release.yml @@ -94,9 +94,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml index ecfc3c8a3..a725fe6df 100644 --- a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml @@ -143,9 +143,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 1656d4598..d41776d15 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -131,12 +131,18 @@ clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* + if dotnet nuget list source | grep "$(WORKING_DIR)/nuget"; then \ + dotnet nuget remove source "$(WORKING_DIR)/nuget" \ + ; fi .PHONY: clean install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet - mkdir -p $(WORKING_DIR)/nuget - find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; + mkdir -p nuget + find sdk/dotnet/bin -name '*.nupkg' -print -exec cp -p "{}" ${WORKING_DIR}/nuget \; + if ! dotnet nuget list source | grep "${WORKING_DIR}/nuget"; then \ + dotnet nuget add source "${WORKING_DIR}/nuget" --name "${WORKING_DIR}/nuget" \ + ; fi @touch $@ install_go_sdk: install_java_sdk: diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index 35fbfc527..b5b7b1ac1 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -158,9 +158,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml index 4f12be75f..b2e9c2a5d 100644 --- a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml @@ -74,9 +74,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language}} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml index 2ddb3f806..19c477061 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -99,9 +99,6 @@ jobs: tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index aae272b83..eceb87303 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -105,9 +105,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml index a52506dea..4ec642229 100644 --- a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml @@ -151,9 +151,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index 1d4a52307..d3a6770df 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -131,12 +131,18 @@ clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* + if dotnet nuget list source | grep "$(WORKING_DIR)/nuget"; then \ + dotnet nuget remove source "$(WORKING_DIR)/nuget" \ + ; fi .PHONY: clean install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet - mkdir -p $(WORKING_DIR)/nuget - find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; + mkdir -p nuget + find sdk/dotnet/bin -name '*.nupkg' -print -exec cp -p "{}" ${WORKING_DIR}/nuget \; + if ! dotnet nuget list source | grep "${WORKING_DIR}/nuget"; then \ + dotnet nuget add source "${WORKING_DIR}/nuget" --name "${WORKING_DIR}/nuget" \ + ; fi @touch $@ install_go_sdk: install_java_sdk: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index fd1e54902..2e0e4ad56 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -148,9 +148,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml index bd7984553..7f87d39b9 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -90,9 +90,6 @@ jobs: tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index b1c592075..5c7cbf910 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -96,9 +96,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml index 186910c6a..363539913 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml @@ -145,9 +145,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index ec07c11cd..97771b726 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -137,12 +137,18 @@ clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* + if dotnet nuget list source | grep "$(WORKING_DIR)/nuget"; then \ + dotnet nuget remove source "$(WORKING_DIR)/nuget" \ + ; fi .PHONY: clean install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet - mkdir -p $(WORKING_DIR)/nuget - find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; + mkdir -p nuget + find sdk/dotnet/bin -name '*.nupkg' -print -exec cp -p "{}" ${WORKING_DIR}/nuget \; + if ! dotnet nuget list source | grep "${WORKING_DIR}/nuget"; then \ + dotnet nuget add source "${WORKING_DIR}/nuget" --name "${WORKING_DIR}/nuget" \ + ; fi @touch $@ install_go_sdk: install_java_sdk: diff --git a/provider-ci/test-providers/docker/.github/workflows/master.yml b/provider-ci/test-providers/docker/.github/workflows/master.yml index f38ba58cb..3bcbd7182 100644 --- a/provider-ci/test-providers/docker/.github/workflows/master.yml +++ b/provider-ci/test-providers/docker/.github/workflows/master.yml @@ -161,9 +161,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml index 2ef0a0a60..960b23c2b 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml @@ -103,9 +103,6 @@ jobs: tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/docker/.github/workflows/release.yml b/provider-ci/test-providers/docker/.github/workflows/release.yml index 128a141a2..d64523feb 100644 --- a/provider-ci/test-providers/docker/.github/workflows/release.yml +++ b/provider-ci/test-providers/docker/.github/workflows/release.yml @@ -109,9 +109,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml index ef71bbba5..7f1d34fc9 100644 --- a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml @@ -158,9 +158,6 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Download bin uses: ./.github/actions/download-bin - - name: Add NuGet source - if: matrix.language == 'dotnet' - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index d1f9992f6..5af9f5c8f 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -137,6 +137,9 @@ clean: rm -rf sdk/{dotnet,nodejs,go,python} rm -rf bin/* rm -rf .make/* + if dotnet nuget list source | grep "$(WORKING_DIR)/nuget"; then \ + dotnet nuget remove source "$(WORKING_DIR)/nuget" \ + ; fi .PHONY: clean docs: .make/docs .make/docs: @@ -146,8 +149,11 @@ docs: .make/docs install_dotnet_sdk: .make/install_dotnet_sdk .make/install_dotnet_sdk: .make/build_dotnet - mkdir -p $(WORKING_DIR)/nuget - find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; + mkdir -p nuget + find sdk/dotnet/bin -name '*.nupkg' -print -exec cp -p "{}" ${WORKING_DIR}/nuget \; + if ! dotnet nuget list source | grep "${WORKING_DIR}/nuget"; then \ + dotnet nuget add source "${WORKING_DIR}/nuget" --name "${WORKING_DIR}/nuget" \ + ; fi @touch $@ install_go_sdk: install_java_sdk: From 8356fca5b9fec64c22b50d24915762f0c57098a2 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Fri, 22 Nov 2024 15:14:15 +0000 Subject: [PATCH 25/29] Fix migration name Co-authored-by: Ian Wahbe --- provider-ci/internal/pkg/migrations/ignoreMakeDir.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider-ci/internal/pkg/migrations/ignoreMakeDir.go b/provider-ci/internal/pkg/migrations/ignoreMakeDir.go index 1415b3f50..4bf453c04 100644 --- a/provider-ci/internal/pkg/migrations/ignoreMakeDir.go +++ b/provider-ci/internal/pkg/migrations/ignoreMakeDir.go @@ -11,7 +11,7 @@ import ( type ignoreMakeDir struct{} func (ignoreMakeDir) Name() string { - return "Fixup Bridge Imports" + return "Add .make directory to .gitignore" } func (ignoreMakeDir) ShouldRun(templateName string) bool { return templateName == "bridged-provider" From 7c90873d613ff94d66f9561bccda3f44c2f4870c Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Mon, 25 Nov 2024 08:49:02 +0000 Subject: [PATCH 26/29] Move build_registry_docs dependency Include as part of `make build` instead of `make build_sdks` as it's not actually an SDK. `build_registry_docs` is also still included as part of `make generate` too. --- provider-ci/internal/pkg/templates/bridged-provider/Makefile | 4 ++-- provider-ci/test-providers/cloudflare/Makefile | 4 ++-- provider-ci/test-providers/docker/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 3d847b928..17f684cb8 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -56,11 +56,11 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) development: build only_build: build # Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks +build: install_plugins provider build_sdks install_sdks#{{- if .Config.RegistryDocs }}# build_registry_docs#{{- end }}# # Creates all generated files which need to be committed generate: generate_sdks schema#{{- if .Config.RegistryDocs }}# build_registry_docs#{{- end }}# generate_sdks:#{{ range .Config.Languages }}# generate_#{{ . }}##{{ end }}# -build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}##{{- if .Config.RegistryDocs }}#build_registry_docs#{{- end }}# +build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}# install_sdks:#{{ range .Config.Languages }}# install_#{{ . }}#_sdk#{{ end }}# .PHONY: development only_build build generate generate_sdks build_sdks install_sdks diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 97771b726..9319ada52 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -40,11 +40,11 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) development: build only_build: build # Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks +build: install_plugins provider build_sdks install_sdks build_registry_docs # Creates all generated files which need to be committed generate: generate_sdks schema build_registry_docs generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java -build_sdks: build_nodejs build_python build_dotnet build_go build_javabuild_registry_docs +build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk .PHONY: development only_build build generate generate_sdks build_sdks install_sdks diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 5af9f5c8f..8d36f1dec 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -40,11 +40,11 @@ _ := $(shell mkdir -p .make bin .pulumi/bin) development: build only_build: build # Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks +build: install_plugins provider build_sdks install_sdks build_registry_docs # Creates all generated files which need to be committed generate: generate_sdks schema build_registry_docs generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java -build_sdks: build_nodejs build_python build_dotnet build_go build_javabuild_registry_docs +build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk .PHONY: development only_build build generate generate_sdks build_sdks install_sdks From 51dc4a1e7c66b1478046dd7311500bcd720ca27c Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Mon, 25 Nov 2024 15:15:04 +0000 Subject: [PATCH 27/29] Add `make prepare_local_workspace` target Run any prerequisites before running build tasks. This is specifically things which need to be done before restoring the `bin` directory in CI and expecting to be able to resume the build. - Ensure upstream has patches applied (if it exists) - Install all Pulumi plugins required for generating docs etc. - Make `build` the default target by moving it first rather than one of its aliases. --- .../internal/pkg/templates/bridged-provider/Makefile | 9 +++++++-- provider-ci/test-providers/acme/Makefile | 9 +++++++-- provider-ci/test-providers/aws/Makefile | 9 +++++++-- provider-ci/test-providers/cloudflare/Makefile | 9 +++++++-- provider-ci/test-providers/docker/Makefile | 9 +++++++-- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 17f684cb8..b1311061b 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -52,11 +52,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) +# Build the provider and all SDKs and install ready for testing +build: install_plugins provider build_sdks install_sdks#{{- if .Config.RegistryDocs }}# build_registry_docs#{{- end }}# # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build -# Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks#{{- if .Config.RegistryDocs }}# build_registry_docs#{{- end }}# +# Prepare the workspace for building the provider and SDKs +# Importantly this is run by CI ahead of restoring the bin directory and resuming SDK builds +prepare_local_workspace: install_plugins upstream # Creates all generated files which need to be committed generate: generate_sdks schema#{{- if .Config.RegistryDocs }}# build_registry_docs#{{- end }}# generate_sdks:#{{ range .Config.Languages }}# generate_#{{ . }}##{{ end }}# @@ -186,6 +189,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +# Install Pulumi plugins required for TFGen to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -243,6 +247,7 @@ bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only +# Apply patches to the upstream submodule, if it exists upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index d41776d15..2c342555b 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) +# Build the provider and all SDKs and install ready for testing +build: install_plugins provider build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build -# Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks +# Prepare the workspace for building the provider and SDKs +# Importantly this is run by CI ahead of restoring the bin directory and resuming SDK builds +prepare_local_workspace: install_plugins upstream # Creates all generated files which need to be committed generate: generate_sdks schema generate_sdks: generate_dotnet generate_go generate_nodejs generate_python @@ -153,6 +156,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +# Install Pulumi plugins required for TFGen to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -207,6 +211,7 @@ bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only +# Apply patches to the upstream submodule, if it exists upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index d3a6770df..c1a5bb3d9 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) +# Build the provider and all SDKs and install ready for testing +build: install_plugins provider build_sdks install_sdks # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build -# Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks +# Prepare the workspace for building the provider and SDKs +# Importantly this is run by CI ahead of restoring the bin directory and resuming SDK builds +prepare_local_workspace: install_plugins upstream # Creates all generated files which need to be committed generate: generate_sdks schema generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java @@ -153,6 +156,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +# Install Pulumi plugins required for TFGen to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -217,6 +221,7 @@ bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only +# Apply patches to the upstream submodule, if it exists upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 9319ada52..5f9733c40 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) +# Build the provider and all SDKs and install ready for testing +build: install_plugins provider build_sdks install_sdks build_registry_docs # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build -# Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks build_registry_docs +# Prepare the workspace for building the provider and SDKs +# Importantly this is run by CI ahead of restoring the bin directory and resuming SDK builds +prepare_local_workspace: install_plugins upstream # Creates all generated files which need to be committed generate: generate_sdks schema build_registry_docs generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java @@ -159,6 +162,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +# Install Pulumi plugins required for TFGen to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -217,6 +221,7 @@ bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only +# Apply patches to the upstream submodule, if it exists upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 8d36f1dec..a069c0181 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -36,11 +36,14 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_UPSTREAM_VERSION) $(LDFLAGS_EXTRAS) $( # Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories. _ := $(shell mkdir -p .make bin .pulumi/bin) +# Build the provider and all SDKs and install ready for testing +build: install_plugins provider build_sdks install_sdks build_registry_docs # Keep aliases for old targets to ensure backwards compatibility development: build only_build: build -# Build the provider and all SDKs and install ready for testing -build: install_plugins provider build_sdks install_sdks build_registry_docs +# Prepare the workspace for building the provider and SDKs +# Importantly this is run by CI ahead of restoring the bin directory and resuming SDK builds +prepare_local_workspace: install_plugins upstream # Creates all generated files which need to be committed generate: generate_sdks schema build_registry_docs generate_sdks: generate_nodejs generate_python generate_dotnet generate_go generate_java @@ -164,6 +167,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk +# Install Pulumi plugins required for TFGen to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -220,6 +224,7 @@ bin/$(TFGEN): (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only +# Apply patches to the upstream submodule, if it exists upstream: .make/upstream # Re-run if the upstream commit or the patches change .make/upstream: $(wildcard patches/*) $(wildcard .git/modules/upstream/HEAD) From 5edada0bd2ef07bf884df1c8d680c798ecfd33b7 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Mon, 25 Nov 2024 14:06:45 +0000 Subject: [PATCH 28/29] Moderize targets in CI In CI, always prepare the local workspace after setting up global requirements (e.g. language SDKs). - Use the new standard targets (schema & provider) instead of the internal targets (tfgen_build_only, tfgen_no_deps, provider_no_deps) - Save and restore makefile progress Save and restore build_sdk makefile progress - Capture .make directory after build_sdk job. Restore before running test step. - Prepare local workspace before restoring progress. Remove duplicate `make upstream` command - The Config.IntegrationTestProvider setting is not enabled yet for any providers. Also restore deps in build_provider - Fix step naming --- .../.github/workflows/build_provider.yml | 10 +++++++--- .../.github/workflows/build_sdk.yml | 15 +++++++++++++-- .../.github/workflows/main.yml | 13 +++++++------ .../.github/workflows/nightly-test.yml | 13 +++++++------ .../.github/workflows/prerelease.yml | 13 +++++++------ .../.github/workflows/prerequisites.yml | 18 ++++++++++-------- .../.github/workflows/release.yml | 13 +++++++------ .../.github/workflows/run-acceptance-tests.yml | 13 +++++++------ .../acme/.github/workflows/build_provider.yml | 10 +++++++--- .../acme/.github/workflows/build_sdk.yml | 15 +++++++++++++-- .../acme/.github/workflows/main.yml | 9 +++++++-- .../acme/.github/workflows/prerelease.yml | 9 +++++++-- .../acme/.github/workflows/prerequisites.yml | 18 ++++++++++-------- .../acme/.github/workflows/release.yml | 9 +++++++-- .../.github/workflows/run-acceptance-tests.yml | 9 +++++++-- .../aws/.github/workflows/build_provider.yml | 10 +++++++--- .../aws/.github/workflows/build_sdk.yml | 15 +++++++++++++-- .../aws/.github/workflows/master.yml | 9 +++++++-- .../aws/.github/workflows/nightly-test.yml | 9 +++++++-- .../aws/.github/workflows/prerelease.yml | 9 +++++++-- .../aws/.github/workflows/prerequisites.yml | 18 ++++++++++-------- .../aws/.github/workflows/release.yml | 9 +++++++-- .../.github/workflows/run-acceptance-tests.yml | 9 +++++++-- .../.github/workflows/build_provider.yml | 10 +++++++--- .../cloudflare/.github/workflows/build_sdk.yml | 15 +++++++++++++-- .../cloudflare/.github/workflows/master.yml | 9 +++++++-- .../.github/workflows/prerelease.yml | 9 +++++++-- .../.github/workflows/prerequisites.yml | 18 ++++++++++-------- .../cloudflare/.github/workflows/release.yml | 9 +++++++-- .../.github/workflows/run-acceptance-tests.yml | 9 +++++++-- .../.github/workflows/build_provider.yml | 10 +++++++--- .../docker/.github/workflows/build_sdk.yml | 15 +++++++++++++-- .../docker/.github/workflows/master.yml | 9 +++++++-- .../docker/.github/workflows/prerelease.yml | 9 +++++++-- .../docker/.github/workflows/prerequisites.yml | 18 ++++++++++-------- .../docker/.github/workflows/release.yml | 9 +++++++-- .../.github/workflows/run-acceptance-tests.yml | 9 +++++++-- 37 files changed, 304 insertions(+), 129 deletions(-) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_provider.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_provider.yml index b02e5ceec..576b9a710 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_provider.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_provider.yml @@ -49,6 +49,8 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, go + - name: Prepare local workspace before restoring previously built + run: make prepare_local_workspace - name: Download schema-embed.json uses: #{{ .Config.ActionVersions.DownloadArtifact }}# with: @@ -57,9 +59,11 @@ jobs: # Avoid creating directories for each artifact merge-multiple: true path: provider/cmd/pulumi-resource-#{{ .Config.Provider }}#/schema-embed.json - - name: Prepare for build - # This installs plugins and prepares upstream - run: make upstream + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: prerequisites.make + path: .make - name: Build & package provider run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }} - name: Upload artifacts diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml index 5191f0430..37a397243 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml @@ -47,12 +47,17 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - - name: Install plugins - run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: prerequisites.make + path: .make - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -68,3 +73,9 @@ jobs: uses: ./.github/actions/upload-sdk with: language: ${{ matrix.language }} + - name: Save makefile progress + uses: #{{ .Config.ActionVersions.UploadArtifact }}# + with: + name: build_${{ matrix.language }}.make + path: .make + include-hidden-files: true diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml index f96e2400d..579da0c8e 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml @@ -150,14 +150,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -204,10 +209,6 @@ jobs: with: ssh-private-key: #{{ .Config.SSHPrivateKey }}# #{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# #{{- if index .Config.SetupScript }}# - name: Run setup script run: #{{ index .Config.SetupScript }}# diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml index e5e5f11c3..30ebe4c35 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml @@ -59,14 +59,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language}} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -113,10 +118,6 @@ jobs: with: ssh-private-key: #{{ .Config.SSHPrivateKey }}# #{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# #{{- if index .Config.SetupScript }}# - name: Run setup script run: #{{ index .Config.SetupScript }}# diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml index 3d2af4ebe..f1fab988c 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml @@ -89,14 +89,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, #{{ range $index, $element := .Config.Languages }}##{{if $index}}#, #{{end}}##{{ $element }}##{{end}}# + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -143,10 +148,6 @@ jobs: with: ssh-private-key: #{{ .Config.SSHPrivateKey }}# #{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# #{{- if index .Config.SetupScript }}# - name: Run setup script run: #{{ index .Config.SetupScript }}# diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml index 7133fe35c..6435d533b 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml @@ -53,23 +53,19 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - name: Setup tools uses: ./.github/actions/setup-tools with: tools: go, pulumictl, pulumicli, schema-tools + - name: Prepare local workspace before restoring previously built files + run: make prepare_local_workspace #{{- if .Config.Actions.PreBuild }}# #{{ .Config.Actions.PreBuild | toYaml | indent 4 }}# #{{- end }}# - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins - name: Generate schema - run: make tfgen_no_deps + run: make schema - name: Build provider binary - run: make provider_no_deps + run: make provider - name: Unit-test provider code run: make test_provider - if: inputs.is_pr @@ -81,6 +77,12 @@ jobs: schema-tools compare -r github://api.github.com/#{{ .Config.Organization }}# -p #{{ .Config.Provider }}# -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-#{{ .Config.Provider }}#/schema.json; echo "$EOF"; } >> "$GITHUB_ENV" + - name: Save makefile progress + uses: #{{ .Config.ActionVersions.UploadArtifact }}# + with: + name: prerequisites.make + path: .make + include-hidden-files: true - if: inputs.is_pr && inputs.is_automated == false name: Comment on PR with Details of Schema Check uses: #{{ .Config.ActionVersions.PrComment }}# diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml index 1c9e3b8c0..f36d77b5d 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml @@ -98,14 +98,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -152,10 +157,6 @@ jobs: with: ssh-private-key: #{{ .Config.SSHPrivateKey }}# #{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# #{{- if index .Config.SetupScript }}# - name: Run setup script run: #{{ index .Config.SetupScript }}# diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index a3a1a18de..f3dd54809 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -146,14 +146,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -200,10 +205,6 @@ jobs: with: ssh-private-key: #{{ .Config.SSHPrivateKey }}# #{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# #{{- if index .Config.SetupScript }}# - name: Run setup script run: #{{ index .Config.SetupScript }}# diff --git a/provider-ci/test-providers/acme/.github/workflows/build_provider.yml b/provider-ci/test-providers/acme/.github/workflows/build_provider.yml index 9c7853b3e..4e7e049a7 100644 --- a/provider-ci/test-providers/acme/.github/workflows/build_provider.yml +++ b/provider-ci/test-providers/acme/.github/workflows/build_provider.yml @@ -37,6 +37,8 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, go + - name: Prepare local workspace before restoring previously built + run: make prepare_local_workspace - name: Download schema-embed.json uses: actions/download-artifact@v4 with: @@ -45,9 +47,11 @@ jobs: # Avoid creating directories for each artifact merge-multiple: true path: provider/cmd/pulumi-resource-acme/schema-embed.json - - name: Prepare for build - # This installs plugins and prepares upstream - run: make upstream + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build & package provider run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }} - name: Upload artifacts diff --git a/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml b/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml index ae5417747..3c38ebe6f 100644 --- a/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml @@ -53,12 +53,17 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - - name: Install plugins - run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -74,3 +79,9 @@ jobs: uses: ./.github/actions/upload-sdk with: language: ${{ matrix.language }} + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make + include-hidden-files: true diff --git a/provider-ci/test-providers/acme/.github/workflows/main.yml b/provider-ci/test-providers/acme/.github/workflows/main.yml index d82f11213..7b783c82a 100644 --- a/provider-ci/test-providers/acme/.github/workflows/main.yml +++ b/provider-ci/test-providers/acme/.github/workflows/main.yml @@ -144,14 +144,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml index b70ade9b2..ee4e388bc 100644 --- a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml @@ -86,14 +86,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, dotnet, go, nodejs, python + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml b/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml index 36e9c47b4..894b85b96 100644 --- a/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml @@ -56,20 +56,16 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - name: Setup tools uses: ./.github/actions/setup-tools with: tools: go, pulumictl, pulumicli, schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins + - name: Prepare local workspace before restoring previously built files + run: make prepare_local_workspace - name: Generate schema - run: make tfgen_no_deps + run: make schema - name: Build provider binary - run: make provider_no_deps + run: make provider - name: Unit-test provider code run: make test_provider - if: inputs.is_pr @@ -81,6 +77,12 @@ jobs: schema-tools compare -r github://api.github.com/pulumiverse -p acme -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-acme/schema.json; echo "$EOF"; } >> "$GITHUB_ENV" + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: prerequisites.make + path: .make + include-hidden-files: true - if: inputs.is_pr && inputs.is_automated == false name: Comment on PR with Details of Schema Check uses: thollander/actions-comment-pull-request@v2 diff --git a/provider-ci/test-providers/acme/.github/workflows/release.yml b/provider-ci/test-providers/acme/.github/workflows/release.yml index f6d5d7696..a0a09445a 100644 --- a/provider-ci/test-providers/acme/.github/workflows/release.yml +++ b/provider-ci/test-providers/acme/.github/workflows/release.yml @@ -92,14 +92,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml index a725fe6df..294ff8140 100644 --- a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml @@ -141,14 +141,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/build_provider.yml b/provider-ci/test-providers/aws/.github/workflows/build_provider.yml index 33f08d4ee..1a4520030 100644 --- a/provider-ci/test-providers/aws/.github/workflows/build_provider.yml +++ b/provider-ci/test-providers/aws/.github/workflows/build_provider.yml @@ -45,6 +45,8 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, go + - name: Prepare local workspace before restoring previously built + run: make prepare_local_workspace - name: Download schema-embed.json uses: actions/download-artifact@v4 with: @@ -53,9 +55,11 @@ jobs: # Avoid creating directories for each artifact merge-multiple: true path: provider/cmd/pulumi-resource-aws/schema-embed.json - - name: Prepare for build - # This installs plugins and prepares upstream - run: make upstream + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build & package provider run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }} - name: Upload artifacts diff --git a/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml b/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml index b8020bb8b..cf0f81f31 100644 --- a/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml @@ -65,12 +65,17 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - - name: Install plugins - run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -86,3 +91,9 @@ jobs: uses: ./.github/actions/upload-sdk with: language: ${{ matrix.language }} + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make + include-hidden-files: true diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index b5b7b1ac1..0b6749fe8 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -156,14 +156,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml index b2e9c2a5d..4c09d7f27 100644 --- a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml @@ -72,14 +72,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language}} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml index 19c477061..cb176530d 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -97,14 +97,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml b/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml index d626c0534..1478d57d7 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml @@ -67,20 +67,16 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - name: Setup tools uses: ./.github/actions/setup-tools with: tools: go, pulumictl, pulumicli, schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins + - name: Prepare local workspace before restoring previously built files + run: make prepare_local_workspace - name: Generate schema - run: make tfgen_no_deps + run: make schema - name: Build provider binary - run: make provider_no_deps + run: make provider - name: Unit-test provider code run: make test_provider - if: inputs.is_pr @@ -92,6 +88,12 @@ jobs: schema-tools compare -r github://api.github.com/pulumi -p aws -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-aws/schema.json; echo "$EOF"; } >> "$GITHUB_ENV" + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: prerequisites.make + path: .make + include-hidden-files: true - if: inputs.is_pr && inputs.is_automated == false name: Comment on PR with Details of Schema Check uses: thollander/actions-comment-pull-request@v2 diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index eceb87303..15a87ccf4 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -103,14 +103,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml index 4ec642229..77d8b9099 100644 --- a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml @@ -149,14 +149,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/build_provider.yml b/provider-ci/test-providers/cloudflare/.github/workflows/build_provider.yml index 8c9605a57..13cec40e3 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/build_provider.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/build_provider.yml @@ -37,6 +37,8 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, go + - name: Prepare local workspace before restoring previously built + run: make prepare_local_workspace - name: Download schema-embed.json uses: actions/download-artifact@v4 with: @@ -45,9 +47,11 @@ jobs: # Avoid creating directories for each artifact merge-multiple: true path: provider/cmd/pulumi-resource-cloudflare/schema-embed.json - - name: Prepare for build - # This installs plugins and prepares upstream - run: make upstream + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build & package provider run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }} - name: Upload artifacts diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml b/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml index f0c948199..db10be5a4 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml @@ -56,12 +56,17 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - - name: Install plugins - run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -77,3 +82,9 @@ jobs: uses: ./.github/actions/upload-sdk with: language: ${{ matrix.language }} + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make + include-hidden-files: true diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index 2e0e4ad56..b1ea15a95 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -146,14 +146,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml index 7f87d39b9..71690612f 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -88,14 +88,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml index e20ae63fd..49241847a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml @@ -58,20 +58,16 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - name: Setup tools uses: ./.github/actions/setup-tools with: tools: go, pulumictl, pulumicli, schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins + - name: Prepare local workspace before restoring previously built files + run: make prepare_local_workspace - name: Generate schema - run: make tfgen_no_deps + run: make schema - name: Build provider binary - run: make provider_no_deps + run: make provider - name: Unit-test provider code run: make test_provider - if: inputs.is_pr @@ -83,6 +79,12 @@ jobs: schema-tools compare -r github://api.github.com/pulumi -p cloudflare -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-cloudflare/schema.json; echo "$EOF"; } >> "$GITHUB_ENV" + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: prerequisites.make + path: .make + include-hidden-files: true - if: inputs.is_pr && inputs.is_automated == false name: Comment on PR with Details of Schema Check uses: thollander/actions-comment-pull-request@v2 diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index 5c7cbf910..4abef064a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -94,14 +94,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml index 363539913..e202f428a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml @@ -143,14 +143,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/build_provider.yml b/provider-ci/test-providers/docker/.github/workflows/build_provider.yml index e9448588d..e2f327521 100644 --- a/provider-ci/test-providers/docker/.github/workflows/build_provider.yml +++ b/provider-ci/test-providers/docker/.github/workflows/build_provider.yml @@ -37,6 +37,8 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, go + - name: Prepare local workspace before restoring previously built + run: make prepare_local_workspace - name: Download schema-embed.json uses: actions/download-artifact@v4 with: @@ -45,9 +47,11 @@ jobs: # Avoid creating directories for each artifact merge-multiple: true path: provider/cmd/pulumi-resource-docker/schema-embed.json - - name: Prepare for build - # This installs plugins and prepares upstream - run: make upstream + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build & package provider run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }} - name: Upload artifacts diff --git a/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml b/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml index 7bb00d3c7..343523d08 100644 --- a/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml @@ -69,12 +69,17 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - - name: Install plugins - run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: prerequisites.make + path: .make - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -90,3 +95,9 @@ jobs: uses: ./.github/actions/upload-sdk with: language: ${{ matrix.language }} + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make + include-hidden-files: true diff --git a/provider-ci/test-providers/docker/.github/workflows/master.yml b/provider-ci/test-providers/docker/.github/workflows/master.yml index 3bcbd7182..9f06bc339 100644 --- a/provider-ci/test-providers/docker/.github/workflows/master.yml +++ b/provider-ci/test-providers/docker/.github/workflows/master.yml @@ -159,14 +159,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml index 960b23c2b..439ae8745 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml @@ -101,14 +101,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml b/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml index fe98f3366..016f2d1a2 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml @@ -71,20 +71,16 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - name: Setup tools uses: ./.github/actions/setup-tools with: tools: go, pulumictl, pulumicli, schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins + - name: Prepare local workspace before restoring previously built files + run: make prepare_local_workspace - name: Generate schema - run: make tfgen_no_deps + run: make schema - name: Build provider binary - run: make provider_no_deps + run: make provider - name: Unit-test provider code run: make test_provider - if: inputs.is_pr @@ -96,6 +92,12 @@ jobs: schema-tools compare -r github://api.github.com/pulumi -p docker -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-docker/schema.json; echo "$EOF"; } >> "$GITHUB_ENV" + - name: Save makefile progress + uses: actions/upload-artifact@v4 + with: + name: prerequisites.make + path: .make + include-hidden-files: true - if: inputs.is_pr && inputs.is_automated == false name: Comment on PR with Details of Schema Check uses: thollander/actions-comment-pull-request@v2 diff --git a/provider-ci/test-providers/docker/.github/workflows/release.yml b/provider-ci/test-providers/docker/.github/workflows/release.yml index d64523feb..0853523ee 100644 --- a/provider-ci/test-providers/docker/.github/workflows/release.yml +++ b/provider-ci/test-providers/docker/.github/workflows/release.yml @@ -107,14 +107,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps diff --git a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml index 7f1d34fc9..d89d2e322 100644 --- a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml @@ -156,14 +156,19 @@ jobs: uses: ./.github/actions/setup-tools with: tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace - name: Download bin uses: ./.github/actions/download-bin - name: Download SDK uses: ./.github/actions/download-sdk with: language: ${{ matrix.language }} - - name: Mark SDK up to date - run: make --touch build_${{ matrix.language }} + - name: Restore makefile progress + uses: actions/download-artifact@v4 + with: + name: build_${{ matrix.language }}.make + path: .make - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps From a0a21262f65d830b7372a618e5858dbd62002718 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Mon, 25 Nov 2024 09:20:48 +0000 Subject: [PATCH 29/29] Add useful help text --- .../pkg/templates/bridged-provider/Makefile | 37 +++++++++++++++++++ provider-ci/test-providers/acme/Makefile | 37 +++++++++++++++++++ provider-ci/test-providers/aws/Makefile | 37 +++++++++++++++++++ .../test-providers/cloudflare/Makefile | 37 +++++++++++++++++++ provider-ci/test-providers/docker/Makefile | 37 +++++++++++++++++++ 5 files changed, 185 insertions(+) diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index b1311061b..8dce96658 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -67,6 +67,43 @@ build_sdks:#{{ range .Config.Languages }}# build_#{{ . }}##{{ end }}# install_sdks:#{{ range .Config.Languages }}# install_#{{ . }}#_sdk#{{ end }}# .PHONY: development only_build build generate generate_sdks build_sdks install_sdks +help: + @echo "Usage: make [target]" + @echo "" + @echo "Main Targets" + @echo " build (default) Build the provider and all SDKs and install for testing" + @echo " generate Generate all SDKs, documentation and schema" + @echo " provider Build the local provider binary" + @echo " lint_provider<.fix> Run the linter on the provider (& optionally fix)" + @echo " test_provider Run the provider tests" + @echo " test Run the example tests (must run 'build' first)" + @echo " clean Clean up generated files" + @echo "" + @echo "More Precise Targets" + @echo " schema Generate the schema" + @echo " generate_sdks Generate all SDKs" + @echo " build_sdks Build all SDKs" + @echo " install_sdks Install all SDKs" + @echo " provider_dist Build and package the provider for all platforms" + @echo "" + @echo "Tool Targets" + @echo " ci-mgmt Re-generate CI configuration from .ci-mgmt.yaml" + @echo " debug_tfgen Start a debug server for tfgen" + @echo "" + @echo "Internal Targets (automatically run as dependencies of other targets)" + @echo " prepare_local_workspace Prepare for building" + @echo " install_plugins Install plugin dependencies" + @echo " upstream Initialize the upstream submodule, if present" + @echo "" + @echo "Language-Specific Targets" + @echo " generate_[language] Generate the SDK files ready for committing" + @echo " build_[language] Build the SDK to check correctness" + @echo " install_[language]_sdk Install the SDK ready for testing" + @echo "" + @echo " [language] =#{{ range .Config.Languages }}# #{{ . }}##{{ end }}#" + @echo "" +.PHONY: help + GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 2c342555b..b2b0e942f 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -51,6 +51,43 @@ build_sdks: build_dotnet build_go build_nodejs build_python install_sdks: install_dotnet_sdk install_go_sdk install_nodejs_sdk install_python_sdk .PHONY: development only_build build generate generate_sdks build_sdks install_sdks +help: + @echo "Usage: make [target]" + @echo "" + @echo "Main Targets" + @echo " build (default) Build the provider and all SDKs and install for testing" + @echo " generate Generate all SDKs, documentation and schema" + @echo " provider Build the local provider binary" + @echo " lint_provider<.fix> Run the linter on the provider (& optionally fix)" + @echo " test_provider Run the provider tests" + @echo " test Run the example tests (must run 'build' first)" + @echo " clean Clean up generated files" + @echo "" + @echo "More Precise Targets" + @echo " schema Generate the schema" + @echo " generate_sdks Generate all SDKs" + @echo " build_sdks Build all SDKs" + @echo " install_sdks Install all SDKs" + @echo " provider_dist Build and package the provider for all platforms" + @echo "" + @echo "Tool Targets" + @echo " ci-mgmt Re-generate CI configuration from .ci-mgmt.yaml" + @echo " debug_tfgen Start a debug server for tfgen" + @echo "" + @echo "Internal Targets (automatically run as dependencies of other targets)" + @echo " prepare_local_workspace Prepare for building" + @echo " install_plugins Install plugin dependencies" + @echo " upstream Initialize the upstream submodule, if present" + @echo "" + @echo "Language-Specific Targets" + @echo " generate_[language] Generate the SDK files ready for committing" + @echo " build_[language] Build the SDK to check correctness" + @echo " install_[language]_sdk Install the SDK ready for testing" + @echo "" + @echo " [language] = dotnet go nodejs python" + @echo "" +.PHONY: help + GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index c1a5bb3d9..0fbd70e7d 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -51,6 +51,43 @@ build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk .PHONY: development only_build build generate generate_sdks build_sdks install_sdks +help: + @echo "Usage: make [target]" + @echo "" + @echo "Main Targets" + @echo " build (default) Build the provider and all SDKs and install for testing" + @echo " generate Generate all SDKs, documentation and schema" + @echo " provider Build the local provider binary" + @echo " lint_provider<.fix> Run the linter on the provider (& optionally fix)" + @echo " test_provider Run the provider tests" + @echo " test Run the example tests (must run 'build' first)" + @echo " clean Clean up generated files" + @echo "" + @echo "More Precise Targets" + @echo " schema Generate the schema" + @echo " generate_sdks Generate all SDKs" + @echo " build_sdks Build all SDKs" + @echo " install_sdks Install all SDKs" + @echo " provider_dist Build and package the provider for all platforms" + @echo "" + @echo "Tool Targets" + @echo " ci-mgmt Re-generate CI configuration from .ci-mgmt.yaml" + @echo " debug_tfgen Start a debug server for tfgen" + @echo "" + @echo "Internal Targets (automatically run as dependencies of other targets)" + @echo " prepare_local_workspace Prepare for building" + @echo " install_plugins Install plugin dependencies" + @echo " upstream Initialize the upstream submodule, if present" + @echo "" + @echo "Language-Specific Targets" + @echo " generate_[language] Generate the SDK files ready for committing" + @echo " build_[language] Build the SDK to check correctness" + @echo " install_[language]_sdk Install the SDK ready for testing" + @echo "" + @echo " [language] = nodejs python dotnet go java" + @echo "" +.PHONY: help + GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index 5f9733c40..dfd486c7c 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -51,6 +51,43 @@ build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk .PHONY: development only_build build generate generate_sdks build_sdks install_sdks +help: + @echo "Usage: make [target]" + @echo "" + @echo "Main Targets" + @echo " build (default) Build the provider and all SDKs and install for testing" + @echo " generate Generate all SDKs, documentation and schema" + @echo " provider Build the local provider binary" + @echo " lint_provider<.fix> Run the linter on the provider (& optionally fix)" + @echo " test_provider Run the provider tests" + @echo " test Run the example tests (must run 'build' first)" + @echo " clean Clean up generated files" + @echo "" + @echo "More Precise Targets" + @echo " schema Generate the schema" + @echo " generate_sdks Generate all SDKs" + @echo " build_sdks Build all SDKs" + @echo " install_sdks Install all SDKs" + @echo " provider_dist Build and package the provider for all platforms" + @echo "" + @echo "Tool Targets" + @echo " ci-mgmt Re-generate CI configuration from .ci-mgmt.yaml" + @echo " debug_tfgen Start a debug server for tfgen" + @echo "" + @echo "Internal Targets (automatically run as dependencies of other targets)" + @echo " prepare_local_workspace Prepare for building" + @echo " install_plugins Install plugin dependencies" + @echo " upstream Initialize the upstream submodule, if present" + @echo "" + @echo "Language-Specific Targets" + @echo " generate_[language] Generate the SDK files ready for committing" + @echo " build_[language] Build the SDK to check correctness" + @echo " install_[language]_sdk Install the SDK ready for testing" + @echo "" + @echo " [language] = nodejs python dotnet go java" + @echo "" +.PHONY: help + GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index a069c0181..8a3b92d85 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -51,6 +51,43 @@ build_sdks: build_nodejs build_python build_dotnet build_go build_java install_sdks: install_nodejs_sdk install_python_sdk install_dotnet_sdk install_go_sdk install_java_sdk .PHONY: development only_build build generate generate_sdks build_sdks install_sdks +help: + @echo "Usage: make [target]" + @echo "" + @echo "Main Targets" + @echo " build (default) Build the provider and all SDKs and install for testing" + @echo " generate Generate all SDKs, documentation and schema" + @echo " provider Build the local provider binary" + @echo " lint_provider<.fix> Run the linter on the provider (& optionally fix)" + @echo " test_provider Run the provider tests" + @echo " test Run the example tests (must run 'build' first)" + @echo " clean Clean up generated files" + @echo "" + @echo "More Precise Targets" + @echo " schema Generate the schema" + @echo " generate_sdks Generate all SDKs" + @echo " build_sdks Build all SDKs" + @echo " install_sdks Install all SDKs" + @echo " provider_dist Build and package the provider for all platforms" + @echo "" + @echo "Tool Targets" + @echo " ci-mgmt Re-generate CI configuration from .ci-mgmt.yaml" + @echo " debug_tfgen Start a debug server for tfgen" + @echo "" + @echo "Internal Targets (automatically run as dependencies of other targets)" + @echo " prepare_local_workspace Prepare for building" + @echo " install_plugins Install plugin dependencies" + @echo " upstream Initialize the upstream submodule, if present" + @echo "" + @echo "Language-Specific Targets" + @echo " generate_[language] Generate the SDK files ready for committing" + @echo " build_[language] Build the SDK to check correctness" + @echo " install_[language]_sdk Install the SDK ready for testing" + @echo "" + @echo " [language] = nodejs python dotnet go java" + @echo "" +.PHONY: help + GEN_PULUMI_HOME := $(WORKING_DIR)/.pulumi GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(GEN_PULUMI_HOME)/examples-cache GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(GEN_PULUMI_CONVERT_EXAMPLES_CACHE_DIR) PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT)