{
    "profiles": {
        "siteground-prod": {
            "host": "${SSH_HOST}",
            "port": "${SSH_PORT}",
            "user": "${SSH_USER}",
            "key_path": "${SSH_KEY_PATH}",
            "repo_root": "${TARGET_REPO_ROOT}",
            "commands": {
                "git_status": {
                    "description": "Ver estado del despliegue y del repo si existe",
                    "risk": "low",
                    "command": "cd {repo_root} && pwd && (git rev-parse --is-inside-work-tree >/dev/null 2>&1 && (git status --short && git branch --show-current) || (echo 'No git repository in deployment root'; ls -la | head -60))"
                },
                "git_pull": {
                    "description": "Actualizar producción desde main",
                    "risk": "high",
                    "command": "cd {repo_root} && git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git fetch origin && git pull --ff-only origin main || (echo 'Deployment root is not a git repository'; exit 1)"
                },
                "composer_lint": {
                    "description": "Ejecutar lint PHP del proyecto",
                    "risk": "low",
                    "command": "cd {repo_root} && composer lint:php"
                },
                "phpstan": {
                    "description": "Ejecutar análisis PHPStan",
                    "risk": "low",
                    "command": "cd {repo_root} && composer analyse:phpstan"
                },
                "psalm": {
                    "description": "Ejecutar análisis Psalm",
                    "risk": "low",
                    "command": "cd {repo_root} && composer analyse:psalm"
                },
                "npm_minify": {
                    "description": "Minificar JS/CSS custom del proyecto",
                    "risk": "medium",
                    "command": "cd {repo_root} && npm run minify:custom"
                },
                "npm_build_grid": {
                    "description": "Compilar build grid-core",
                    "risk": "medium",
                    "command": "cd {repo_root} && npm run build:grid-core"
                },
                "tail_php_errorlog": {
                    "description": "Leer últimas líneas de php_errorlog",
                    "risk": "low",
                    "command": "tail -n 120 {repo_root}/../php_errorlog"
                },
                "cache_flush": {
                    "description": "Vaciar OPcache en el servidor",
                    "risk": "medium",
                    "command": "php -r \"opcache_reset();\""
                }
            }
        }
    }
}
