feat: funciones Go de deploy — systemd, VPS setup, deploy remoto
Nuevas funciones infra para deploy sin Docker: generación de units systemd (pura), instalación/restart/status de servicios remotos via SSH, setup inicial de VPS (crear dirs, usuario, permisos), y pipelines de deploy completo (setup_vps_app, deploy_app_remote). Incluye tipo DeployConfig con la configuración de deploy por app.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: DeployConfig
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
algebraic: product
|
||||
definition: "type DeployConfig struct { AppName, LocalDir, RemoteDir, BinaryName, BuildCmd, ServiceUser string; Port int; HealthPath string; Env map[string]string }"
|
||||
description: "Parametriza un deploy de app a un VPS remoto. Agrupa nombre, rutas, build, servicio, puerto, health check y env vars."
|
||||
tags: [deploy, config, vps, remote, infra]
|
||||
uses_types: []
|
||||
file_path: "functions/infra/deploy_config.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
cfg := DeployConfig{
|
||||
AppName: "dag_engine",
|
||||
LocalDir: "apps/dag_engine",
|
||||
RemoteDir: "/opt/apps/dag_engine",
|
||||
BinaryName: "dag_engine",
|
||||
BuildCmd: "CGO_ENABLED=0 GOOS=linux go build -o dag_engine .",
|
||||
ServiceUser: "deploy",
|
||||
Port: 8080,
|
||||
HealthPath: "/api/health",
|
||||
Env: map[string]string{"DB_PATH": "/opt/apps/dag_engine/data/ops.db"},
|
||||
}
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Usado por los pipelines `setup_vps_app` y `deploy_app_remote`. El campo `BuildCmd` se ejecuta localmente con `bash -c` en el directorio `LocalDir`. Si `HealthPath` está vacío o `Port` es 0, se omite el health check.
|
||||
Reference in New Issue
Block a user