21 lines
569 B
Bash
Executable File
21 lines
569 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
inv_dir="${repo_root}/infrastructure/terraform/proxmox"
|
|
json_out="${repo_root}/data/terraform/proxmox-inventory.json"
|
|
md_out="${repo_root}/docs/generated/host-topology.md"
|
|
|
|
mkdir -p "$(dirname "${json_out}")" "$(dirname "${md_out}")"
|
|
|
|
(
|
|
cd "${inv_dir}"
|
|
terraform output -json infrastructure_inventory > "${json_out}"
|
|
)
|
|
|
|
python3 "${repo_root}/scripts/docs/generate_host_topology.py" \
|
|
--input "${json_out}" \
|
|
--output "${md_out}"
|
|
|
|
echo "Generated: ${md_out}"
|