Skip to content

Commit

Permalink
Improvements...
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondshtogu committed Jul 9, 2023
1 parent e52377f commit 1b5e2fe
Show file tree
Hide file tree
Showing 63 changed files with 3,399 additions and 3,745 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
**/.idea
**/.ionide
.pulumi
Pulumi.*.yaml
yarn.lock
package-lock.json
ci-scripts
/nuget/
provider/**/schema-embed.json
examples/.env
!examples/.env-template
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,3 @@ install_go_sdk::
install_nodejs_sdk::
-yarn unlink --cwd $(WORKING_DIR)/sdk/nodejs/bin
yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin


up_simple_test:: provider install_provider install_nodejs_sdk
pulumi up --cwd examples/simple/ --yes --skip-preview --verbose 9
6 changes: 6 additions & 0 deletions examples/.env-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ESXI_HOST=<esxi host>
ESXI_USERNAME=<esxi username>
ESXI_PASSWORD=<esxi password>
ESXI_SSH_PORT=22
ESXI_SSL_PORT=443
ESXI_OVFTOOL_LOCATION=<data-store-name>
1 change: 1 addition & 0 deletions examples/01_simple_virtual_machine/nodejs/Pulumi.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/01_simple_virtual_machine/nodejs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 01_simple_virtual_machine_nodejs
runtime: nodejs
description: An esxi simple virtual machine example
15 changes: 15 additions & 0 deletions examples/01_simple_virtual_machine/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";

let vm: esxi.VirtualMachine;
vm = new esxi.VirtualMachine("vm-test", {
diskStore: "nvme-ssd-datastore",
networkInterfaces: [
{
virtualNetwork: "default"
}
]
});

export const id = vm.id;
export const name = vm.name;
export const os = vm.os;
10 changes: 10 additions & 0 deletions examples/01_simple_virtual_machine/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "simple-virtual-machine-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 02_cloned_virtual_machine_complete_build_nodejs
runtime: nodejs
description: An esxi cloned virtual machine complete build example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "cloned-virtual-machine-complete-build-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 03_resource_pools_additional_storage_nodejs
runtime: nodejs
description: An esxi simple virtual machine example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";
10 changes: 10 additions & 0 deletions examples/03_resource_pools_additional_storage/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "resource-pools-additional-storage-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
1 change: 1 addition & 0 deletions examples/04_core_os_and_ignition/nodejs/Pulumi.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/04_core_os_and_ignition/nodejs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 04_core_os_and_ignition_nodejs
runtime: nodejs
description: An esxi CoreOS and Ignition example
1 change: 1 addition & 0 deletions examples/04_core_os_and_ignition/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";
10 changes: 10 additions & 0 deletions examples/04_core_os_and_ignition/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "core-os-and-ignition-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/05_cloud_init_and_templates/nodejs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 05_cloud_init_and_templates_nodejs
runtime: nodejs
description: An esxi cloud init and templates usage example
1 change: 1 addition & 0 deletions examples/05_cloud_init_and_templates/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";
10 changes: 10 additions & 0 deletions examples/05_cloud_init_and_templates/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "cloud-init-and-templates-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
1 change: 1 addition & 0 deletions examples/06_ovf_properties/nodejs/Pulumi.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/06_ovf_properties/nodejs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 06_ovf_properties_nodejs
runtime: nodejs
description: An esxi ovf properties usage example
3 changes: 3 additions & 0 deletions examples/06_ovf_properties/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";


10 changes: 10 additions & 0 deletions examples/06_ovf_properties/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "ovf-properties-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
1 change: 1 addition & 0 deletions examples/07_networking/nodejs/Pulumi.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/07_networking/nodejs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 07_networking_nodejs
runtime: nodejs
description: An esxi networking example
1 change: 1 addition & 0 deletions examples/07_networking/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xyz-typescript",
"version": "0.1.0",
"name": "networking-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions examples/08_networking_cloud_init/nodejs/Pulumi.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/08_networking_cloud_init/nodejs/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 08_networking_cloud_init_nodejs
runtime: nodejs
description: An esxi networking cloud init example
1 change: 1 addition & 0 deletions examples/08_networking_cloud_init/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import * as esxi from "@edmondshtogu/pulumi-esxi-native";
10 changes: 10 additions & 0 deletions examples/08_networking_cloud_init/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "networking-cloud-init-typescript",
"version": "0.0.1",
"devDependencies": {
"@types/node": "latest"
},
"dependencies": {
"@pulumi/pulumi": "latest"
}
}
90 changes: 90 additions & 0 deletions examples/examples_nodejs_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package examples

import (
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
"path/filepath"
"testing"
)

func Test01SimpleVirtualMachineTs(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "01_simple_virtual_machine", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test02ClonedVirtualMachineCompleteBuild(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "02_cloned_virtual_machine_complete_build", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test03ResourcePoolsAdditionalStorage(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "03_resource_pools_additional_storage", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test04CoreOSAndIgnition(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "04_core_os_and_ignition", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test05CloudInitAndTemplates(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "05_cloud_init_and_templates", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test06OVFProperties(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "06_ovf_properties", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test07Networking(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "07_networking", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func Test08NetworkingCloudInit(t *testing.T) {
test := getNodeJSBaseOptions(t).
With(integration.ProgramTestOptions{
Dir: filepath.Join(getCwd(t), "08_networking_cloud_init", "nodejs"),
})

integration.ProgramTest(t, &test)
}

func getNodeJSBaseOptions(t *testing.T) integration.ProgramTestOptions {
base := getBaseOptions(t)
baseJS := base.With(integration.ProgramTestOptions{
Dependencies: []string{
"@edmondshtogu/pulumi-esxi-native",
},
})

return baseJS
}
Loading

0 comments on commit 1b5e2fe

Please sign in to comment.