6b8bcd0939
rsync_deploy sincroniza directorio local a remoto via SSH con exclusiones estándar (.git, node_modules, *.db, etc.). gitea_create_webhook crea webhook de push en un repo Gitea para auto-deploy en cada commit.
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 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gitea_create_webhook | function | bash | infra | 1.0.0 | impure | gitea_create_webhook(owner: string, repo: string, target_url: string, secret?: string) -> json | Crea un webhook de push en un repositorio Gitea. El webhook notifica a target_url en cada push. |
|
false | error_go_core |
|
JSON con webhook_id, owner, repo, target_url | false | bash/functions/infra/gitea_create_webhook.sh |
Ejemplo
source bash/functions/infra/gitea_create_webhook.sh
export GITEA_URL="https://git.example.com"
export GITEA_TOKEN="$(pass agentes/dataforge-token)"
# Crear webhook para auto-deploy
gitea_create_webhook "myorg" "dag_engine" "http://vps:9090/webhook/push" "mi_secreto"
# {"webhook_id":42,"owner":"myorg","repo":"dag_engine","target_url":"http://vps:9090/webhook/push"}
Notas
- Requiere
GITEA_URLyGITEA_TOKENcomo variables de entorno. - Solo escucha eventos
push. Para otros eventos, modificar el arrayeventsen el payload. - Si el webhook ya existe para la misma URL, Gitea crea uno duplicado (no es idempotente).