syntaxis/config/provctl/scripts/export-config.nu
Jesús Pérez faf0d2c6b9
Some checks failed
Build - Verify Code & Build Binaries / Check Code Format (push) Has been cancelled
Build - Verify Code & Build Binaries / Lint with Clippy (push) Has been cancelled
Build - Verify Code & Build Binaries / Test Suite (push) Has been cancelled
Build - Verify Code & Build Binaries / Cargo Check (push) Has been cancelled
Build - Verify Code & Build Binaries / Security Audit (push) Has been cancelled
Build - Verify Code & Build Binaries / Build (Debug) - macos-latest (push) Has been cancelled
Build - Verify Code & Build Binaries / Build (Debug) - ubuntu-latest (push) Has been cancelled
Build - Verify Code & Build Binaries / Build (Debug) - windows-latest (push) Has been cancelled
Build - Verify Code & Build Binaries / Build (Release) - macos-latest (push) Has been cancelled
Build - Verify Code & Build Binaries / Build (Release) - ubuntu-latest (push) Has been cancelled
Build - Verify Code & Build Binaries / Build (Release) - windows-latest (push) Has been cancelled
Build - Verify Code & Build Binaries / All Checks Passed (push) Has been cancelled
CI/CD with Staging Preset / Validate Installation with Staging Preset (macos-latest) (push) Has been cancelled
CI/CD with Staging Preset / Validate Installation with Staging Preset (ubuntu-latest) (push) Has been cancelled
CI/CD with Staging Preset / Build and Test with Staging Preset (push) Has been cancelled
CI/CD with Staging Preset / Integration Test with Docker Compose (push) Has been cancelled
CI/CD with Staging Preset / Validate Documentation (push) Has been cancelled
CI/CD with Staging Preset / Test Summary (push) Has been cancelled
Provisioning Tests / Provisioning Tests (macos-latest) (push) Has been cancelled
Provisioning Tests / Provisioning Tests (ubuntu-20.04) (push) Has been cancelled
Provisioning Tests / Provisioning Tests (ubuntu-latest) (push) Has been cancelled
Provisioning Tests / Lint Provisioning Scripts (push) Has been cancelled
Provisioning Tests / Test Report (push) Has been cancelled
chore: reorganization following layout_conventions.md
2025-12-26 18:46:38 +00:00

164 lines
3.4 KiB
Plaintext

#!/usr/bin/env nu
# export-config.nu - Export deployment configuration as environment variables
#
# Generated by: provctl gen deployment
# Generated at: 2025-11-20
#
# Exports deployment configuration from KCL as environment variables
# Usage:
# source export-config.nu
# echo $env.DEPLOYMENT_PROJECT_NAME
# echo $env.ENABLED_SERVICES
# Project information
export-env {
$env.DEPLOYMENT_PROJECT_NAME = "myproject"
$env.DEPLOYMENT_PROJECT_VERSION = "1.0.0"
$env.DEPLOYMENT_PROJECT_DESCRIPTION = "y"
}
# Enabled services
export-env {
$env.SERVICE_CLI_ENABLED = "false"
}
export-env {
$env.SERVICE_TUI_ENABLED = "false"
}
export-env {
$env.SERVICE_API_ENABLED = "false"
}
export-env {
$env.SERVICE_DASHBOARD_ENABLED = "false"
}
# Database configuration
export-env {
$env.DATABASE_DEFAULT = "sqlite"
$env.SUPPORTED_DATABASES = [] # Populated by deployment configuration
}
export-env {
$env.DATABASE_SQLITE_ENABLED = "false"
}
export-env {
$env.DATABASE_POSTGRES_ENABLED = "false"
}
export-env {
$env.DATABASE_MYSQL_ENABLED = "false"
}
export-env {
$env.DATABASE_SURREALDB_ENABLED = "false"
}
# Cache configuration
export-env {
$env.CACHE_ENABLED = "false"
}
# Deployment presets
export-env {
$env.AVAILABLE_PRESETS = [
"n"
]
$env.DEFAULT_PRESET = "dev"
}
# Helper functions for common operations
# List all enabled services
def services [] {
"""List all enabled services in this deployment"""
[
{
name: "myproject-cli"
type: "cli"
requires: []
}
,
{
name: "myproject-dashboard"
type: "web"
requires: ["api"]
}
]
}
# List all configured databases
def databases [] {
"""List all configured database backends"""
[
{
type: "sqlite"
host: ""
port: ""
path: "/var/lib/myproject/db.sqlite"
}
]
}
# List all deployment presets
def presets [] {
"""List all available deployment presets"""
[
{
name: "n"
}
]
}
# Print deployment summary
def summary [] {
"""Print a summary of this deployment configuration"""
print $"Project: myproject v1.0.0"
print $"Description: y"
print ""
print "Enabled Services:"
services | each { |svc|
if $svc.port != null {
print $" - ($svc.name) [$svc.type]:($svc.port)"
} else {
print $" - ($svc.name) [$svc.type]"
}
}
print ""
print "Databases:"
databases | each { |db|
if $db.host != null {
print $" - ($db.type) (($db.host):($db.port))"
} else if $db.path != null {
print $" - ($db.type) (($db.path))"
} else {
print $" - ($db.type)"
}
}
print ""
print "Available Presets:"
presets | each { |preset|
print $" - ($preset.name): ($preset.description)"
}
}
# Export for easy access
export def services [] {
"""List all enabled services in this deployment"""
services
}
export def databases [] {
"""List all configured database backends"""
databases
}
export def presets [] {
"""List all available deployment presets"""
presets
}
export def summary [] {
"""Print a summary of this deployment configuration"""
summary
}
# Print summary when sourced
print "Deployment configuration loaded: myproject"
print "Run 'summary' to see deployment overview"