Skip to content

Commit

Permalink
chore: ensure schema-embed.json is accurate when examples are generat…
Browse files Browse the repository at this point in the history
…ed (#227)

The example generator script includes some code to replace the current
Equinix Pulumi plugin version in generated examples with `< 1.0.0` (or
the equivalent per language). The script uses `.pulumi/bin/pulumictl get
version --language generic` to determine the version number that should
be replaced. However, the examples are not necessarily generated to
reference that plugin version. The version referenced in examples
appears to come from
`provider/cmd/pulumi-resource-equinix/schema-embed.json`.

This adds `build_schema` as a dependency of the `only_provider` Make
task. The `only_provider` task is already a dependency of the `examples`
task and the files produced by `build_schema` are necessary for
`only_provider`.

This change ensures that the schema files are up-to-date before examples
are generated.
  • Loading branch information
ctreatma authored Oct 24, 2024
1 parent d7fb4df commit 49f125e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bin/pulumi-java-gen: .pulumi-java-gen.version $(PULUMICTL_BIN)
provider: tfgen install_plugins # build the provider binary
provider: only_provider

only_provider: $(PULUMICTL_BIN)
only_provider: build_schema $(PULUMICTL_BIN)
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION} -X github.com/equinix/terraform-provider-equinix/version.ProviderVersion=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${PROVIDER})

build_sdks: clean build_nodejs build_python build_go build_dotnet build_java # build all the sdks
Expand Down

0 comments on commit 49f125e

Please sign in to comment.