Skip to content
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
11 changes: 2 additions & 9 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,11 @@ tasks:
desc: Generate Terraform documentation
silent: true
cmds:
- cmd: rm -rf docs/terraform/*
- cmd: |
find terraform -type d -exec test -e '{}/main.tf' -a -e '{}/variables.tf' \; -print | while read -r dir; do
if [[ "$dir" == *"/modules/"* ]]; then
continue
fi
rel_path="${dir#terraform/}"
output_file="docs/terraform/$rel_path.md"
mkdir -p "$(dirname "$output_file")"
if [ -f "$dir/README.md" ]; then
cat "$dir/README.md" > "$output_file"
echo >> "$output_file"
fi
docker run --rm -v "$(pwd):/src" -w "/src/$dir" quay.io/terraform-docs/terraform-docs:0.20.0 markdown . >> "$output_file"
echo "Generating docs for $dir"
docker run --rm -v "$(pwd):/src" -w "/src/$dir" quay.io/terraform-docs/terraform-docs:0.20.0 markdown table --output-file README.md --output-mode inject .
done
99 changes: 0 additions & 99 deletions docs/terraform/cluster/azure-aks.md

This file was deleted.

9 changes: 3 additions & 6 deletions terraform/.terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
formatter: markdown
formatter: markdown table

recursive:
enabled: true
Expand All @@ -7,16 +7,13 @@ recursive:

sections:
show:
- header
- requirements
- providers
- inputs
- outputs
- resources

content: |-
{{ .Header }}

{{ .Requirements }}

{{ .Providers }}
Expand All @@ -28,8 +25,8 @@ content: |-
{{ .Resources }}

output:
file: "docs/terraform/{{ dir .Path }}/{{ .Name }}.md"
mode: replace
file: "README.md"
mode: inject

settings:
anchor: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -44,3 +45,4 @@ No modules.
## Outputs

No outputs.
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -51,3 +52,4 @@ No modules.
## Outputs

No outputs.
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -77,3 +78,4 @@ No modules.
## Outputs

No outputs.
<!-- END_TF_DOCS -->
Loading
Loading