feat: add bash infra functions — Gitea, Android SDK, Mantine, Capacitor
Nuevas funciones bash: gestión Gitea (create_repo, list_repos, add_collaborator, push_directory), install_android_sdk, install_mantine, frontend_doctor. Pipelines: capacitor_build_apk y gitea_init_app. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: gitea_create_repo
|
||||
kind: function
|
||||
lang: bash
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "gitea_create_repo(owner: string, name: string, private: string, description: string) -> string"
|
||||
description: "Crea un repositorio en Gitea para un owner. Intenta crearlo en org primero; si el owner no es una org (404/422), lo crea en el usuario autenticado. No falla fatalmente si el repo ya existe (409)."
|
||||
tags: [gitea, git, repo, create, infra, api]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: []
|
||||
params:
|
||||
- name: owner
|
||||
desc: "usuario u organización propietaria del repo"
|
||||
- name: name
|
||||
desc: "nombre del repositorio a crear"
|
||||
- name: private
|
||||
desc: "si el repo es privado, 'true' o 'false' (default: false)"
|
||||
- name: description
|
||||
desc: "descripción del repositorio (opcional)"
|
||||
output: "JSON del repositorio creado según la API de Gitea"
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "bash/functions/infra/gitea_create_repo.sh"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```bash
|
||||
source bash/functions/infra/gitea_create_repo.sh
|
||||
|
||||
export GITEA_URL="https://git.example.com"
|
||||
export GITEA_TOKEN="$(pass agentes/dataforge-token)"
|
||||
|
||||
# Crear repo público en org o usuario
|
||||
repo_json=$(gitea_create_repo "myorg" "my-app")
|
||||
|
||||
# Crear repo privado con descripción
|
||||
repo_json=$(gitea_create_repo "myorg" "my-app" "true" "Mi aplicación principal")
|
||||
|
||||
# Extraer la URL del clon
|
||||
clone_url=$(echo "$repo_json" | jq -r '.clone_url')
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
- Requiere variables de entorno `GITEA_URL` y `GITEA_TOKEN` seteadas antes de invocar.
|
||||
- El fallback org → usuario ocurre con HTTP 404 o 422 en el endpoint de orgs.
|
||||
- Un 409 se reporta a stderr pero la función retorna 0 — el repo ya existe es una condición aceptable para idempotencia.
|
||||
- Los mensajes informativos van a stderr; el JSON de respuesta va a stdout.
|
||||
Reference in New Issue
Block a user