Skip to content

Commit

Permalink
Add new make target for documentation.
Browse files Browse the repository at this point in the history
This can be used to generate some initial draft documentation.
The final documentation will live in this repo:

  https://github.com/HPE/terraform-provider-hpegl
  • Loading branch information
stuart-mclaren-hpe committed Sep 4, 2024
1 parent 18bfc32 commit 0461c65
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
#
# Note: this Makefile works with GNUMake and BSDMake
#
.PHONY: test docs

PROVIDER_TF = \
terraform { \\n \
required_providers { \\n \
hpegl = { \\n \
source = \"github.com/HewlettPackard/hpegl-pcbe-terraform-resources\" \\n \
} \\n \
} \\n \
}

build:
go build ./...
Expand All @@ -15,6 +25,14 @@ install:
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;
rm __docs.tf

test:
go test ./...

Expand Down

0 comments on commit 0461c65

Please sign in to comment.