diff --git a/devtools/scripts/git/clone-workspace.sh b/devtools/scripts/git/clone-workspace.sh new file mode 100755 index 000000000..1a4bcee50 --- /dev/null +++ b/devtools/scripts/git/clone-workspace.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# ============================================================================= +# clone-workspace.sh +# ============================================================================= +# Clona el workspace-v1 completo con todos los submodules +# Generado: 2026-01-04 +# EPIC: EPIC-010 +# ============================================================================= + +set -e + +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' + +DEFAULT_REPO="git@gitea-server:rckrdmrd/workspace-v1.git" +DEFAULT_DIR="workspace-v1" + +REPO_URL="${1:-$DEFAULT_REPO}" +TARGET_DIR="${2:-$DEFAULT_DIR}" + +echo "==============================================" +echo " CLONE WORKSPACE-V1" +echo "==============================================" +echo "Repositorio: $REPO_URL" +echo "Destino: $TARGET_DIR" +echo "" + +if [ -d "$TARGET_DIR" ]; then + echo -e "${RED}ERROR${NC}: El directorio '$TARGET_DIR' ya existe" + exit 1 +fi + +echo "=== Clonando repositorio ===" +git clone --recurse-submodules "$REPO_URL" "$TARGET_DIR" + +cd "$TARGET_DIR" +git submodule init +git submodule update --recursive + +echo "" +echo -e "${GREEN}CLONE COMPLETADO${NC}" +echo "Workspace en: $(pwd)" diff --git a/devtools/scripts/git/sync-submodules.sh b/devtools/scripts/git/sync-submodules.sh new file mode 100755 index 000000000..3186a33d2 --- /dev/null +++ b/devtools/scripts/git/sync-submodules.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# ============================================================================= +# sync-submodules.sh +# ============================================================================= +# Sincroniza todos los submodules a sus ultimas versiones +# Generado: 2026-01-04 +# EPIC: EPIC-010 +# ============================================================================= + +set -e + +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +AUTO_COMMIT=false +[ "$1" == "--commit" ] && AUTO_COMMIT=true + +if [ ! -d ".git" ]; then + echo "ERROR: No es un repositorio Git" + exit 1 +fi + +echo "==============================================" +echo " SYNC SUBMODULES" +echo "==============================================" + +echo "=== Estado actual ===" +git submodule status + +echo "" +echo "=== Sincronizando ===" +git submodule sync --recursive +git submodule update --remote --merge + +echo "" +echo "=== Nuevo estado ===" +git submodule status + +CHANGES=$(git status --porcelain) +if [ -n "$CHANGES" ]; then + echo "" + echo -e "${YELLOW}Cambios detectados${NC}" + if [ "$AUTO_COMMIT" = true ]; then + git add . + git commit -m "chore: update submodules" + echo -e "${GREEN}Commit creado${NC}" + else + echo "Para commit: $0 --commit" + fi +else + echo -e "${GREEN}Submodules actualizados${NC}" +fi diff --git a/orchestration/referencias/REPOSITORY-STRUCTURE.md b/orchestration/referencias/REPOSITORY-STRUCTURE.md new file mode 100644 index 000000000..c9c67d105 --- /dev/null +++ b/orchestration/referencias/REPOSITORY-STRUCTURE.md @@ -0,0 +1,120 @@ +# Estructura de Repositorios - Workspace-v1 + +**Version:** 1.0.0 +**Fecha:** 2026-01-04 +**Sistema:** NEXUS v3.4 +**EPIC:** EPIC-010 + +--- + +## 1. Vision General + +``` +workspace-v1/ # Repositorio principal (Gitea) +├── .git/ +├── .gitignore +├── .gitmodules # Define submodule gamilit +├── core/ # Sistema SIMCO y catalogo +├── shared/ # Recursos compartidos +├── orchestration/ # Orquestacion de agentes +├── devtools/ # Herramientas de desarrollo +├── control-plane/ # Control de servicios +└── projects/ + ├── gamilit/ # SUBMODULE -> GitHub + ├── trading-platform/ + ├── erp-suite/ + └── ... +``` + +--- + +## 2. Repositorios Remotos + +### Gitea (Principal) +| Campo | Valor | +|-------|-------| +| URL Web | http://72.60.226.4:3000 | +| Usuario | rckrdmrd | +| URL SSH | git@gitea-server:rckrdmrd/workspace-v1.git | + +### GitHub (gamilit) +| Campo | Valor | +|-------|-------| +| Usuario | rckrdmrd | +| Repositorio | gamilit-workspace | +| URL SSH | git@github.com:rckrdmrd/gamilit-workspace.git | + +--- + +## 3. Submodules + +### gamilit +- **Path:** projects/gamilit +- **URL:** git@github.com:rckrdmrd/gamilit-workspace.git +- **Branch:** main +- **Razon:** Servidor productivo separado + +--- + +## 4. Estrategia de Branches + +| Branch | Proposito | +|--------|-----------| +| main | Produccion estable | +| develop | Integracion | +| feature/* | Desarrollo | +| hotfix/* | Fixes urgentes | + +--- + +## 5. Scripts de Gestion + +### clone-workspace.sh +```bash +./devtools/scripts/git/clone-workspace.sh +``` + +### sync-submodules.sh +```bash +./devtools/scripts/git/sync-submodules.sh [--commit] +``` + +--- + +## 6. Comandos Comunes + +### Clonar +```bash +git clone --recurse-submodules git@gitea-server:rckrdmrd/workspace-v1.git +``` + +### Nueva feature +```bash +git checkout develop +git checkout -b feature/EPIC-XXX-desc +``` + +### Actualizar submodule +```bash +git submodule update --remote projects/gamilit +``` + +--- + +## 7. SSH Config + +``` +Host gitea-server + HostName 72.60.226.4 + User git + IdentityFile ~/.ssh/id_ed25519 + +Host github.com + HostName github.com + User git + IdentityFile ~/.ssh/id_ed25519 +``` + +--- + +**Generado:** 2026-01-04