-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To ensure that 'make docs' functionality does not break.
- Loading branch information
1 parent
d633174
commit 998072a
Showing
3 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 Hewlett Packard Enterprise Development LP | ||
name: Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
docs: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.22.3' | ||
- uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.9.5 | ||
- run: make install-experimental | ||
- run: go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected] | ||
- run: make docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,23 @@ install-experimental: | |
go install -tags experimental ./... | ||
|
||
docs: | ||
echo -e ${PROVIDER_TF} > __docs.tf; \ | ||
tempfile=$$(mktemp); \ | ||
terraform providers schema -json | \ | ||
sed '[email protected]/hewlettpackard/hpegl-pcbe-terraform-resources@hpegl@g' > $$tempfile; \ | ||
tfplugindocs generate --providers-schema $$tempfile -provider-name hpegl; | ||
printf "${PROVIDER_TF}" > __docs.tf; \ | ||
cat __docs.tf; \ | ||
tfconfig=$$(mktemp); \ | ||
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tfconfig; \ | ||
cat $$tfconfig; \ | ||
cp $$tfconfig /tmp/tfconfig; \ | ||
schemafile=$$(mktemp); \ | ||
env TF_CLI_CONFIG_FILE=$$tfconfig terraform providers schema -json | \ | ||
sed '[email protected]/hewlettpackard/hpegl-pcbe-terraform-resources@hpegl@g' > $$schemafile; \ | ||
echo "xxx1"; \ | ||
cat $$schemafile; \ | ||
echo "xxx2"; \ | ||
tail $$schemafile; \ | ||
echo "xxx3"; \ | ||
cp $$schemafile /tmp/schema.json; \ | ||
rm __docs.tf | ||
tfplugindocs generate --providers-schema test/schema.json -provider-name hpegl; | ||
|
||
test: | ||
go test ./... | ||
|
@@ -42,9 +53,9 @@ testacc: | |
|
||
testacc-simulation: | ||
go install -tags experimental,simulation ./cmd/... | ||
tempfile=$$(mktemp); \ | ||
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tempfile; \ | ||
env TF_ACC=1 env TF_CLI_CONFIG_FILE=$$tempfile \ | ||
tfconfig=$$(mktemp); \ | ||
sed "s@__HOME__@${HOME}@g" test/.terraformrc > $$tfconfig; \ | ||
env TF_ACC=1 env TF_CLI_CONFIG_FILE=$$tfconfig \ | ||
go test -v -tags simulation ./test/... | ||
|
||
lint: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"format_version":"1.0","provider_schemas":{"hpegl":{"provider":{"version":0,"block":{"block_types":{"pc":{"nesting_mode":"single","block":{"attributes":{"host":{"type":"string","description_kind":"plain","required":true},"http_dump":{"type":"bool","description_kind":"plain","optional":true},"max_polls":{"type":"number","description_kind":"plain","optional":true},"poll_interval":{"type":"number","description_kind":"plain","optional":true},"token":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"resource_schemas":{"hpegl_pc_datastore":{"version":0,"block":{"attributes":{"capacity_in_bytes":{"type":"number","description":"Size of the datastore in bytes.","description_kind":"markdown","required":true},"cluster_info":{"nested_type":{"attributes":{"id":{"type":"string","description":"UUID string uniquely identifying the hypervisor cluster.","description_kind":"markdown","computed":true},"name":{"type":"string","description":"Name of the cluster as reported by the hypervisor manager.","description_kind":"markdown","required":true}},"nesting_mode":"single"},"description_kind":"plain","required":true},"datacenters_info":{"nested_type":{"attributes":{"id":{"type":"string","description":"UUID string uniquely identifier of the datacenter.","description_kind":"markdown","computed":true},"name":{"type":"string","description":"VMware provided name for the datacenter.","description_kind":"markdown","computed":true}},"nesting_mode":"list"},"description":"List of datacenters to which the datastore is presented to.","description_kind":"markdown","computed":true},"datastore_type":{"type":"string","description":"Supported datastore types are VMFS or vVOL","description_kind":"markdown","required":true},"hci_cluster_uuid":{"type":"string","description":"UUID string uniquely identifying the HCI cluster.","description_kind":"markdown","required":true},"id":{"type":"string","description":"UUID string uniquely identifying the datastore","description_kind":"markdown","computed":true},"name":{"type":"string","description":"The data store name","description_kind":"markdown","required":true}},"description_kind":"plain"}},"hpegl_pc_hypervisor_cluster":{"version":0,"block":{"attributes":{"app_info":{"nested_type":{"attributes":{"vmware":{"nested_type":{"attributes":{"datacenter_info":{"nested_type":{"attributes":{"name":{"type":"string","description":"VMware provided name for the datacenter.","description_kind":"markdown","required":true}},"nesting_mode":"single"},"description":"References to the datacenter that house this virtual machine.","description_kind":"markdown","required":true}},"nesting_mode":"single"},"description_kind":"plain","required":true}},"nesting_mode":"single"},"description":"Application specific information for this cluster.","description_kind":"markdown","required":true},"hci_cluster_uuid":{"type":"string","description":"UUID string uniquely identifying the HCI cluster.","description_kind":"markdown","required":true},"id":{"type":"string","description":"UUID string uniquely identifying the hypervisor cluster.","description_kind":"markdown","computed":true},"name":{"type":"string","description":"Name of the cluster as reported by the hypervisor manager.","description_kind":"markdown","required":true}},"description_kind":"plain"}},"hpegl_pc_server":{"version":0,"block":{"attributes":{"id":{"type":"string","description":"An identifier for the resource, usually a UUID.","description_kind":"markdown","computed":true},"name":{"type":"string","description":"A system specified name for the resource.","description_kind":"markdown","required":true},"system_id":{"type":"string","description":"Unique Identifier of the system, usually a UUID.","description_kind":"markdown","required":true}},"description_kind":"plain"}}},"data_source_schemas":{"hpegl_pc_system":{"version":0,"block":{"attributes":{"id":{"type":"string","description":"Unique Identifier of the system, usually a UUID.","description_kind":"markdown","computed":true},"name":{"type":"string","description":"A system specified name for the resource.","description_kind":"markdown","required":true}},"description_kind":"plain"}}}}}} |