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

chore(ci): generate examples with the pulumi installed by Make #154

Merged
merged 3 commits into from
Aug 20, 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ help:
clean:
rm -rf sdk/{dotnet,nodejs,go,python,java}

install_equinix_plugin: only_provider uninstall_equinix_plugin
install_equinix_plugin: only_provider uninstall_equinix_plugin .pulumi/bin/pulumi
.pulumi/bin/pulumi plugin install resource equinix $(shell pulumictl get version --language generic) --file $(WORKING_DIR)/bin/$(PROVIDER)

uninstall_equinix_plugin:
uninstall_equinix_plugin: .pulumi/bin/pulumi
.pulumi/bin/pulumi plugin rm resource equinix -a -y

install_plugins: .pulumi/bin/pulumi
Expand Down
14 changes: 7 additions & 7 deletions scripts/generate_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ generate_pulumi_yaml() {

# Generate Pulumi template
echo -e "\033[0;34m CONVERTING $normalized_path"
pulumi convert --cwd "$resource_dir" --from terraform --language yaml --out $resource_dir --generate-only "${tf_files[0]}"
.pulumi/bin/pulumi convert --cwd "$resource_dir" --from terraform --language yaml --out $resource_dir --generate-only "${tf_files[0]}"
sed -i.bak $'1i\\\n# WARNING: This is an autogenerated file - manual changes will be overwritten if not made via ./scripts/generate_examples.sh\n' "$resource_dir/Pulumi.yaml"
rm "$tf_destination_file" "$resource_dir"/*.bak

Expand Down Expand Up @@ -180,7 +180,7 @@ generate_pulumi_yaml() {

# Execute the Terraform to YAML conversion
echo -e "\033[0;34m CONVERTING $normalized_path"
pulumi convert --cwd "$resource_dir" --from terraform --language yaml --out $resource_dir --generate-only $tf_file
.pulumi/bin/pulumi convert --cwd "$resource_dir" --from terraform --language yaml --out $resource_dir --generate-only $tf_file
sed -i.bak $'1i\\\n# WARNING: This is an autogenerated file - manual changes will be overwritten if not made via ./scripts/generate_examples.sh\n' "$resource_dir/Pulumi.yaml"
rm "$tf_destination_file" "$resource_dir"/*.bak

Expand Down Expand Up @@ -220,11 +220,11 @@ generate_examples_and_docs() {
OUTPUT_FILE="${OUTPUT_DIR}/${NORMALIZED_NAME}.examples.md"

# Convert Pulumi configurations to all languages
pulumi convert --cwd "$PULUMI_DIR" --language python --out python --generate-only || true
pulumi convert --cwd "$PULUMI_DIR" --language typescript --out typescript --generate-only || true
pulumi convert --cwd "$PULUMI_DIR" --language java --out java --generate-only || true
pulumi convert --cwd "$PULUMI_DIR" --language go --out go || true
pulumi convert --cwd "$PULUMI_DIR" --language csharp --out csharp --generate-only || true
.pulumi/bin/pulumi convert --cwd "$PULUMI_DIR" --language python --out python --generate-only || true
.pulumi/bin/pulumi convert --cwd "$PULUMI_DIR" --language typescript --out typescript --generate-only || true
.pulumi/bin/pulumi convert --cwd "$PULUMI_DIR" --language java --out java --generate-only || true
.pulumi/bin/pulumi convert --cwd "$PULUMI_DIR" --language go --out go || true
.pulumi/bin/pulumi convert --cwd "$PULUMI_DIR" --language csharp --out csharp --generate-only || true

# Fix version constraints
## csharp
Expand Down
Loading