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.3 KiB
1.3 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 | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| systemd_install | function | go | infra | 1.0.0 | impure | func SystemdInstall(conn SSHConn, unitName, unitContent string) error | Sube un unit file al host remoto, hace daemon-reload, enable y restart. Idempotente: reemplaza si el unit ya existe. |
|
|
|
false | error_go_core |
|
|
nil si el unit se instaló y arrancó correctamente | false | functions/infra/systemd_install.go |
Ejemplo
conn := SSHConn{Host: "192.168.1.100", User: "deploy"}
unit := SystemdGenerateUnit("dag_engine", "/opt/apps/dag_engine/dag_engine", "/opt/apps/dag_engine", "deploy", nil)
err := SystemdInstall(conn, "dag_engine", unit)
Notas
Escribe el unit a un archivo temporal en /tmp y lo mueve con sudo a /etc/systemd/system/. Requiere que el usuario SSH tenga permisos sudo sin password para systemctl y mv a /etc/systemd/system/.