Files
tf_provider/devops/02_generate_resources_and_docs.sh
T
“Naeel” a9491e13ea refactor: extract all generators into independent TOOLS/ modules
Each generator is now a standalone Go module with its own go.mod:

TOOLS/
├── yaml-generator/       ← service_spec_gen (API → YAML)
├── resource-generator/   ← gen_v2 (YAML → Go resources)
├── docs-generator/       ← docs_template_gen_v2 (YAML → Markdown)
├── ops-generator/        ← ops_docs_gen (ops documentation)
└── bin/                  ← pre-built binaries

All scripts updated to use TOOLS/bin/* binaries.
Removed old universal_rebuild/tools/ and universal_rebuild/bin/.
2026-07-05 09:57:13 +04:00

25 lines
889 B
Bash
Executable File

#!/usr/bin/env bash
# Generate Go resources and documentation from unified YAML.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="${ROOT_DIR:-$(cd "${SCRIPT_DIR}/.." && pwd)}"
PROVIDER_DIR="${ROOT_DIR}/universal_rebuild"
DOCS_DIR="${ROOT_DIR}/docs/30_registry/resources"
cd "$PROVIDER_DIR"
# Remove old generated resources (keep core files).
rm -f "${PROVIDER_DIR}/internal/resources_gen"/*_resource.go
rm -f "${PROVIDER_DIR}/internal/resources_gen/registry.go"
# Step 1: generate Go resources from unified YAML.
echo "Generating Go resources from unified YAML..."
${ROOT_DIR}/TOOLS/bin/resource-generator
# Step 2: generate documentation from unified YAML (new template).
echo "Generating documentation using new template generator..."
"${ROOT_DIR}/devops/02_generate_resources_and_docs_template_v2.sh"
echo "Done. Docs updated in ${DOCS_DIR}"