Compare commits

..

2 Commits

Author SHA1 Message Date
69ae923d1b add terraform 2025-05-22 15:32:40 +02:00
e245b99487 Revert "test pre-commit"
This reverts commit c806506a0a8a50feb74265c6b599a13004e43f20.
2025-05-22 15:24:14 +02:00
2 changed files with 25 additions and 1 deletions

View File

@ -1 +0,0 @@
infolegale

View File

@ -0,0 +1,25 @@
## Auto-generated documentation for Terraform module
### Installation de terraform-docs
```bash
cd /tmp/
wget https://github.com/terraform-docs/terraform-docs/releases/download/v0.16.0/terraform-docs-v0.16.0-linux-amd64.tar.gz
tar xf terraform-docs-v0.16.0-linux-amd64.tar.gz
sudo mv terraform-docs /usr/local/bin
```
## Hook pre-commit
```bash
cat << EOF > .git/hooks/pre-commit
#!/bin/sh
# Keep module docs up to date
target_dir=$(find . -type f -name "*.tf" -not -path "*/.terraform/*" -exec dirname {} \; | sort -u)
for d in ${target_dir}; do
if terraform-docs -c .terraform-docs.yml --output-file README.md $d ; then
git add "./$d/README.md"
fi
done
EOF