Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update makefile to execute build_schema twice #164

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
PROJECT_NAME := equinix Package

WORKING_DIR := $(shell pwd)
BIN_DIR := $(WORKING_DIR)/.pulumi/bin
PULUMICTL_BIN := $(BIN_DIR)/pulumictl
export PATH := $(BIN_DIR):$(PATH)

PULUMICTL_VERSION := v0.0.46

SHELL := /bin/bash
PACK := equinix
ORG := equinix
Expand All @@ -17,10 +24,6 @@ JAVA_GROUP_ID := com.${ORG}.pulumi
JAVA_ARTIFACT_ID := ${PACK}
TESTPARALLELISM := 4

WORKING_DIR := $(shell pwd)
BIN_DIR := $(WORKING_DIR)/.pulumi/bin
PULUMICTL_BIN := $(BIN_DIR)/pulumictl

OS := $(shell uname | tr '[:upper:]' '[:lower:]')
ARCH := $(shell uname -m)
ifeq ($(ARCH),x86_64)
Expand All @@ -29,8 +32,6 @@ endif

EMPTY_TO_AVOID_SED := ""

PULUMICTL_VERSION := v0.0.46

# estimated target version of the plugin that is currently being generated
VERSION = $(shell $(PULUMICTL_BIN) get version)
PACKAGE_VERSION = $(shell $(PULUMICTL_BIN) get version --language generic)
Expand All @@ -48,11 +49,11 @@ only_tfgen: install_plugins upstream build_schema
tfgen: only_tfgen generate_examples

# Generate examples after the schema is generated
generate_examples: examples build_schema
generate_examples: examples build_schema_post_examples

# Build the tfgen binary and generate the schema
build_schema: $(PULUMICTL_BIN)
build_schema:
build_schema build_schema_post_examples: $(PULUMICTL_BIN)
build_schema build_schema_post_examples:
(cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN})
$(WORKING_DIR)/bin/${TFGEN} schema --out provider/cmd/${PROVIDER}
(cd provider && VERSION=$(VERSION) go generate cmd/${PROVIDER}/main.go)
Expand Down Expand Up @@ -214,7 +215,12 @@ upstream.rebase:
scripts/upstream_old.sh "$@" start_rebase

.pulumi/bin/pulumi: .pulumi/version
curl -fsSL https://get.pulumi.com | HOME=$(WORKING_DIR) sh -s -- --version $(cat .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)"; \
else \
curl -fsSL https://get.pulumi.com | \
HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \
fi

$(PULUMICTL_BIN):
@mkdir -p $(BIN_DIR)
Expand All @@ -226,8 +232,8 @@ examples: install_equinix_plugin $(PULUMICTL_BIN)
scripts/generate_examples.sh

# Compute the version of Pulumi to use by inspecting the Go dependencies of the provider.
.pulumi/version:
.pulumi/version: provider/go.mod
@mkdir -p .pulumi
@cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@

.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_equinix_plugin uninstall_equinix_plugin install_plugins lint_provider provider test tfgen upstream upstream.finalize upstream.rebase test_provider examples examples_check
.PHONY: development build build_schema build_schema_post_examples 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_equinix_plugin uninstall_equinix_plugin install_plugins lint_provider provider test tfgen upstream upstream.finalize upstream.rebase test_provider examples examples_check
38 changes: 19 additions & 19 deletions docs/resource/equinix_fabric_cloud_router.examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,28 @@ import pulumi_equinix as equinix
new_cloud_router = equinix.fabric.CloudRouter("newCloudRouter",
name="Router-SV",
type="XF_ROUTER",
notifications=[equinix.fabric.CloudRouterNotificationArgs(
type="ALL",
emails=[
notifications=[{
"type": "ALL",
"emails": [
"[email protected]",
"[email protected]",
],
)],
order=equinix.fabric.CloudRouterOrderArgs(
purchase_order_number="1-323292",
),
location=equinix.fabric.CloudRouterLocationArgs(
metro_code="SV",
),
package=equinix.fabric.CloudRouterPackageArgs(
code="STANDARD",
),
project=equinix.fabric.CloudRouterProjectArgs(
project_id="776847000642406",
),
account=equinix.fabric.CloudRouterAccountArgs(
account_number=203612,
))
}],
order={
"purchase_order_number": "1-323292",
},
location={
"metro_code": "SV",
},
package={
"code": "STANDARD",
},
project={
"project_id": "776847000642406",
},
account={
"account_number": 203612,
})
```
```go
package main
Expand Down
Loading
Loading