Files
egutierrez f21664e052 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.
2026-04-12 17:29:52 +02:00

1007 B

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_restart function go infra 1.0.0 impure func SystemdRestart(conn SSHConn, unitName string) error Reinicia un servicio systemd en un host remoto via SSH.
systemd
restart
service
remote
ssh_exec_go_infra
ssh_conn_go_infra
false error_go_core
fmt
name desc
conn conexión SSH al host remoto
name desc
unitName nombre del unit systemd a reiniciar (sin .service)
nil si el reinicio fue exitoso false
functions/infra/systemd_restart.go

Ejemplo

conn := SSHConn{Host: "192.168.1.100", User: "deploy"}
if err := SystemdRestart(conn, "dag_engine"); err != nil {
    log.Fatal(err)
}

Notas

Usa sudo systemctl restart. Requiere que el usuario SSH tenga permisos sudo. Si el servicio no existe, systemctl retorna error.