refactor: restructure project — separate tools, config, generated, provider
TOOLS/ — generators + scripts + config + ARCHITECTURE.md ├── yaml-generator/ (code) ├── resource-generator/ (code) ├── docs-generator/ (code) ├── scripts/ (← devops/*.sh) ├── config/ (← devops/profiles/ + devops/config/) │ ├── test/ profile.env, services_list.txt, operation_timeouts.json │ ├── prod/ │ └── dev/ └── ARCHITECTURE.md (← devops/ARCHITECTURE.md) generated/ — pipeline output only (gitignored) ├── test/resources_yaml/, go/, docs/, provider_build/ ├── prod/ └── dev/ provider/ — code only, no generated files resources_yaml/ — DELETED (generated) internal/resources_gen/ — DELETED (generated) devops/ — removed (replaced by TOOLS/scripts + TOOLS/config + generated/) Generators now fail if NUBES_*_DIR not set (no defaults to provider/). Provider requires pipeline to populate resources_gen/ before build.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// generate_resources_v2 — главный генератор Terraform-провайдера Nubes.
|
||||
//
|
||||
// ⛔ ПОДЧИНЯЕТСЯ devops/ARCHITECTURE.md — все правила генерации прописаны там.
|
||||
// ⛔ ПОДЧИНЯЕТСЯ TOOLS/ARCHITECTURE.md — все правила генерации прописаны там.
|
||||
//
|
||||
// Пайплайн: YAML-спеки сервисов → Go-ресурсы + registry.go.
|
||||
//
|
||||
@@ -17,7 +17,6 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"resource-generator/internal/loader"
|
||||
@@ -25,17 +24,13 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
root, err := os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
resourcesDir := strings.TrimSpace(os.Getenv("NUBES_RESOURCES_DIR"))
|
||||
if resourcesDir == "" {
|
||||
resourcesDir = filepath.Join(root, "resources_yaml")
|
||||
panic("NUBES_RESOURCES_DIR is required — must point to generated/{stand}/resources_yaml/")
|
||||
}
|
||||
outDir := strings.TrimSpace(os.Getenv("NUBES_RESOURCES_GEN_DIR"))
|
||||
if outDir == "" {
|
||||
outDir = filepath.Join(root, "internal", "resources_gen")
|
||||
panic("NUBES_RESOURCES_GEN_DIR is required — must point to generated/{stand}/go/")
|
||||
}
|
||||
|
||||
instanceResources, subresources, actions, err := loader.LoadSpecs(resourcesDir)
|
||||
|
||||
Reference in New Issue
Block a user