Skip to content

Commit

Permalink
Ensure plugins are installed before running tfgen (#1198)
Browse files Browse the repository at this point in the history
We need the plugins available at runtime of tfgen for generating
examples etc.

Found while trying to repro #1197
  • Loading branch information
danielrbradley authored Dec 4, 2024
1 parent e7696df commit b7f0e10
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions provider-ci/internal/pkg/templates/bridged-provider/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G
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)
.make/generate_dotnet: .make/install_plugins 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 && \
Expand All @@ -125,7 +125,7 @@ build_dotnet: .make/build_dotnet
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)
.make/generate_go: .make/install_plugins bin/$(TFGEN)
$(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
@touch $@
.make/build_go: .make/generate_go
Expand All @@ -137,7 +137,7 @@ 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
.make/generate_java: .make/install_plugins 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 $@
Expand All @@ -152,7 +152,7 @@ build_java: .make/build_java
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)
.make/generate_nodejs: .make/install_plugins 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 $@
Expand All @@ -167,7 +167,7 @@ build_nodejs: .make/build_nodejs
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)
.make/generate_python: .make/install_plugins 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/
Expand All @@ -186,7 +186,7 @@ build_python: .make/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
build_registry_docs: .make/build_registry_docs
.make/build_registry_docs: bin/$(TFGEN)
.make/build_registry_docs: .make/install_plugins bin/$(TFGEN)
bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs
@touch $@
.PHONY: build_registry_docs
Expand Down
10 changes: 5 additions & 5 deletions provider-ci/test-providers/acme/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G
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)
.make/generate_dotnet: .make/install_plugins 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 && \
Expand All @@ -109,7 +109,7 @@ build_dotnet: .make/build_dotnet
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)
.make/generate_go: .make/install_plugins bin/$(TFGEN)
$(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
@touch $@
.make/build_go: .make/generate_go
Expand All @@ -121,7 +121,7 @@ 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
.make/generate_java: .make/install_plugins 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 $@
Expand All @@ -136,7 +136,7 @@ build_java: .make/build_java
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)
.make/generate_nodejs: .make/install_plugins 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 $@
Expand All @@ -151,7 +151,7 @@ build_nodejs: .make/build_nodejs
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)
.make/generate_python: .make/install_plugins 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/
Expand Down
10 changes: 5 additions & 5 deletions provider-ci/test-providers/aws/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G
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)
.make/generate_dotnet: .make/install_plugins 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 && \
Expand All @@ -109,7 +109,7 @@ build_dotnet: .make/build_dotnet
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)
.make/generate_go: .make/install_plugins bin/$(TFGEN)
$(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
@touch $@
.make/build_go: .make/generate_go
Expand All @@ -121,7 +121,7 @@ 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
.make/generate_java: .make/install_plugins 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 $@
Expand All @@ -136,7 +136,7 @@ build_java: .make/build_java
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)
.make/generate_nodejs: .make/install_plugins 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 $@
Expand All @@ -151,7 +151,7 @@ build_nodejs: .make/build_nodejs
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)
.make/generate_python: .make/install_plugins 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/
Expand Down
12 changes: 6 additions & 6 deletions provider-ci/test-providers/cloudflare/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G
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)
.make/generate_dotnet: .make/install_plugins 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 && \
Expand All @@ -109,7 +109,7 @@ build_dotnet: .make/build_dotnet
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)
.make/generate_go: .make/install_plugins bin/$(TFGEN)
$(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
@touch $@
.make/build_go: .make/generate_go
Expand All @@ -121,7 +121,7 @@ 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
.make/generate_java: .make/install_plugins 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 $@
Expand All @@ -136,7 +136,7 @@ build_java: .make/build_java
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)
.make/generate_nodejs: .make/install_plugins 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 $@
Expand All @@ -151,7 +151,7 @@ build_nodejs: .make/build_nodejs
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)
.make/generate_python: .make/install_plugins 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/
Expand All @@ -168,7 +168,7 @@ build_python: .make/build_python
.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
build_registry_docs: .make/build_registry_docs
.make/build_registry_docs: bin/$(TFGEN)
.make/build_registry_docs: .make/install_plugins bin/$(TFGEN)
bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs
@touch $@
.PHONY: build_registry_docs
Expand Down
12 changes: 6 additions & 6 deletions provider-ci/test-providers/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G
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)
.make/generate_dotnet: .make/install_plugins 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 && \
Expand All @@ -109,7 +109,7 @@ build_dotnet: .make/build_dotnet
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)
.make/generate_go: .make/install_plugins bin/$(TFGEN)
$(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/
@touch $@
.make/build_go: .make/generate_go
Expand All @@ -121,7 +121,7 @@ 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
.make/generate_java: .make/install_plugins 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 $@
Expand All @@ -136,7 +136,7 @@ build_java: .make/build_java
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)
.make/generate_nodejs: .make/install_plugins 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 $@
Expand All @@ -151,7 +151,7 @@ build_nodejs: .make/build_nodejs
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)
.make/generate_python: .make/install_plugins 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/
Expand All @@ -168,7 +168,7 @@ build_python: .make/build_python
.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
build_registry_docs: .make/build_registry_docs
.make/build_registry_docs: bin/$(TFGEN)
.make/build_registry_docs: .make/install_plugins bin/$(TFGEN)
bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs
@touch $@
.PHONY: build_registry_docs
Expand Down

0 comments on commit b7f0e10

Please sign in to comment.