feat: funciones infra — Docker, deploy, build y health check

Funciones impuras para gestión de contenedores: docker_build_image,
docker_compose_up/down, docker_volume_create/list/remove,
generate_dockerfile, write_dockerfile, go_build_binary, health_check_http,
deploy_app y stop_app. Todas con tests unitarios donde aplica.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-30 14:24:12 +02:00
parent b5a6711c64
commit 90693fb32f
34 changed files with 1386 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package infra
import (
"fmt"
"os/exec"
"strings"
)
// DockerVolumeCreate crea un volume Docker con el nombre dado.
// Retorna el nombre del volume creado.
func DockerVolumeCreate(name string) (string, error) {
out, err := exec.Command("docker", "volume", "create", name).CombinedOutput()
if err != nil {
return "", fmt.Errorf("docker volume create %s: %s", name, strings.TrimSpace(string(out)))
}
return strings.TrimSpace(string(out)), nil
}