New projects created: - michangarrito (marketplace mobile) - template-saas (SaaS template) - clinica-dental (dental ERP) - clinica-veterinaria (veterinary ERP) Architecture updates: - Move catalog from core/ to shared/ - Add MCP servers structure and templates - Add git management scripts - Update SUBREPOSITORIOS.md with 15 new repos - Update .gitignore for new projects Repository infrastructure: - 4 main repositories - 11 subrepositorios - Gitea remotes configured 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
148 lines
5.1 KiB
Bash
Executable File
148 lines
5.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# =============================================================================
|
|
# Script: Crear repositorios en Gitea via API
|
|
# Fecha: 2026-01-04
|
|
# Uso: ./create-gitea-repos-api.sh <GITEA_TOKEN>
|
|
# =============================================================================
|
|
|
|
GITEA_URL="http://72.60.226.4:3000"
|
|
GITEA_USER="rckrdmrd"
|
|
|
|
# Colores
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m'
|
|
|
|
# Verificar token
|
|
if [ -z "$1" ]; then
|
|
echo -e "${RED}Error: Se requiere token de API${NC}"
|
|
echo ""
|
|
echo "Uso: $0 <GITEA_TOKEN>"
|
|
echo ""
|
|
echo "Para obtener el token:"
|
|
echo " 1. Ir a ${GITEA_URL}/${GITEA_USER}"
|
|
echo " 2. Settings -> Applications -> Generate New Token"
|
|
echo " 3. Dar permisos de 'repo' y 'write:repository'"
|
|
exit 1
|
|
fi
|
|
|
|
GITEA_TOKEN="$1"
|
|
|
|
echo -e "${GREEN}=== Creando repositorios en Gitea via API ===${NC}"
|
|
echo ""
|
|
|
|
# Funcion para crear repositorio
|
|
create_repo() {
|
|
local repo_name=$1
|
|
local description=$2
|
|
|
|
echo -ne "${YELLOW}Creando: $repo_name... ${NC}"
|
|
|
|
# Verificar si existe
|
|
exists=$(curl -s -o /dev/null -w "%{http_code}" \
|
|
"${GITEA_URL}/api/v1/repos/${GITEA_USER}/${repo_name}" \
|
|
-H "Authorization: token ${GITEA_TOKEN}")
|
|
|
|
if [ "$exists" = "200" ]; then
|
|
echo -e "${GREEN}Ya existe${NC}"
|
|
return 0
|
|
fi
|
|
|
|
# Crear repositorio
|
|
response=$(curl -s -X POST \
|
|
"${GITEA_URL}/api/v1/user/repos" \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"name\": \"${repo_name}\",
|
|
\"description\": \"${description}\",
|
|
\"private\": false,
|
|
\"auto_init\": false
|
|
}")
|
|
|
|
# Verificar resultado
|
|
if echo "$response" | grep -q "\"name\":\"${repo_name}\""; then
|
|
echo -e "${GREEN}Creado${NC}"
|
|
else
|
|
error=$(echo "$response" | python3 -c "import json,sys; print(json.load(sys.stdin).get('message', 'Unknown error'))" 2>/dev/null)
|
|
echo -e "${RED}Error: $error${NC}"
|
|
fi
|
|
}
|
|
|
|
# =============================================================================
|
|
# REPOSITORIOS PRINCIPALES DE PROYECTOS
|
|
# =============================================================================
|
|
|
|
echo "--- Repositorios Principales ---"
|
|
echo ""
|
|
|
|
# ERP Suite
|
|
create_repo "erp-suite" "ERP Suite - Sistema multi-vertical"
|
|
|
|
# ERP Core
|
|
create_repo "erp-core" "ERP Core - Modulos base compartidos"
|
|
|
|
# ERP Verticales
|
|
create_repo "erp-construccion" "ERP para empresas de construccion"
|
|
create_repo "erp-clinicas" "ERP para clinicas medicas"
|
|
create_repo "erp-retail" "ERP para retail"
|
|
create_repo "erp-mecanicas-diesel" "ERP para mecanicas diesel"
|
|
create_repo "erp-vidrio-templado" "ERP para fabricas de vidrio templado"
|
|
|
|
# Otros proyectos
|
|
create_repo "trading-platform" "Plataforma de trading y educacion financiera"
|
|
create_repo "betting-analytics" "Analytics para apuestas deportivas"
|
|
create_repo "inmobiliaria-analytics" "Analytics inmobiliario"
|
|
create_repo "platform-marketing-content" "Plataforma de marketing de contenido"
|
|
|
|
echo ""
|
|
echo "--- Subrepositorios ERP Retail ---"
|
|
echo ""
|
|
create_repo "erp-retail-backend" "ERP Retail - Backend API"
|
|
create_repo "erp-retail-frontend-web" "ERP Retail - Frontend Web"
|
|
create_repo "erp-retail-database" "ERP Retail - Database Scripts"
|
|
|
|
echo ""
|
|
echo "--- Subrepositorios Trading Platform ---"
|
|
echo ""
|
|
create_repo "trading-platform-backend" "Trading Platform - Backend API"
|
|
create_repo "trading-platform-frontend" "Trading Platform - Frontend Web"
|
|
create_repo "trading-platform-database" "Trading Platform - Database Scripts"
|
|
create_repo "trading-platform-ml-engine" "Trading Platform - ML Engine"
|
|
create_repo "trading-platform-data-service" "Trading Platform - Data Service"
|
|
|
|
echo ""
|
|
echo "--- Subrepositorios Betting Analytics ---"
|
|
echo ""
|
|
create_repo "betting-analytics-backend" "Betting Analytics - Backend API"
|
|
create_repo "betting-analytics-frontend" "Betting Analytics - Frontend Web"
|
|
create_repo "betting-analytics-database" "Betting Analytics - Database Scripts"
|
|
|
|
echo ""
|
|
echo "--- Subrepositorios Inmobiliaria Analytics ---"
|
|
echo ""
|
|
create_repo "inmobiliaria-analytics-backend" "Inmobiliaria Analytics - Backend API"
|
|
create_repo "inmobiliaria-analytics-frontend" "Inmobiliaria Analytics - Frontend Web"
|
|
create_repo "inmobiliaria-analytics-database" "Inmobiliaria Analytics - Database Scripts"
|
|
|
|
echo ""
|
|
echo "--- Subrepositorios Platform Marketing Content ---"
|
|
echo ""
|
|
create_repo "platform-marketing-content-backend" "Platform Marketing Content - Backend API"
|
|
create_repo "platform-marketing-content-frontend" "Platform Marketing Content - Frontend Web"
|
|
create_repo "platform-marketing-content-database" "Platform Marketing Content - Database Scripts"
|
|
|
|
echo ""
|
|
echo -e "${GREEN}=== Proceso completado ===${NC}"
|
|
echo ""
|
|
echo "Para hacer push de cada proyecto:"
|
|
echo " cd /home/isem/workspace-v1/projects/[PROYECTO]"
|
|
echo " git push -u origin main"
|
|
echo ""
|
|
echo "Subrepositorios configurados:"
|
|
echo " - erp-construccion: backend, frontend, database (YA PUSHED)"
|
|
echo " - erp-core: backend, frontend, database (YA PUSHED)"
|
|
echo " - erp-mecanicas-diesel: backend, frontend, database (YA PUSHED)"
|
|
echo ""
|