f21664e052
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.
1.6 KiB
1.6 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| setup_vps_app | pipeline | go | infra | 1.0.0 | impure | func SetupVPSApp(conn SSHConn, cfg DeployConfig) error | Orquesta el setup inicial de una app en un VPS remoto: verifica SSH, crea dirs y usuario, sube binario, instala systemd unit y hace health check. |
|
|
|
false | error_go_core |
|
|
nil si el setup completo fue exitoso | false | functions/infra/setup_vps_app.go |
Ejemplo
conn := SSHConn{Host: "185.x.x.x", User: "root"}
cfg := DeployConfig{
AppName: "dag_engine",
LocalDir: "apps/dag_engine",
RemoteDir: "/opt/apps/dag_engine",
BinaryName: "dag_engine",
ServiceUser: "deploy",
Port: 8080,
HealthPath: "/api/health",
Env: map[string]string{"PORT": "8080"},
}
err := SetupVPSApp(conn, cfg)
Notas
Pipeline de 6 pasos para primera instalación. Después del setup inicial, usar deploy_app_remote para deploys continuos (no regenera dirs ni systemd unit). El health check espera hasta 30 segundos con polling cada 2s.