a06946e410
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 | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| deploy_app_remote | pipeline | go | infra | 1.0.0 | impure | func DeployAppRemote(conn SSHConn, cfg DeployConfig) error | Orquesta el deploy continuo de una app a un VPS: verifica SSH, compila localmente, sube binario, reinicia systemd y hace health check. |
|
|
|
false | error_go_core |
|
|
nil si el deploy completo fue exitoso | false | functions/infra/deploy_app_remote.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",
BuildCmd: "CGO_ENABLED=0 GOOS=linux go build -o dag_engine .",
Port: 8080,
HealthPath: "/api/health",
}
err := DeployAppRemote(conn, cfg)
Notas
Pipeline de 5 pasos para deploy continuo (asume que el setup inicial ya se hizo con setup_vps_app). El build corre localmente en LocalDir con bash -c BuildCmd. Si BuildCmd está vacío, se salta el build y sube directamente el binario existente.