feat(commands,bash): estandarizar todos los apps y analyses como dataforge/<name>
- /full-git-push y /full-git-pull descubren apps/analyses sin .git y los inicializan/clonan automaticamente contra dataforge/<basename>. - ensure_repo_synced.sh: localizar gitea_create_repo.sh / gitea_push_directory.sh via FN_REGISTRY_INFRA_DIR o FN_REGISTRY_ROOT (mas robusto al sourcing desde directorios arbitrarios y desde zsh). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,10 +8,11 @@ Trae los últimos cambios del remote para el repo principal `fn_registry`, todos
|
||||
|
||||
## Pasos
|
||||
|
||||
### 1. Descubrir repos
|
||||
### 1. Descubrir repos + clonar dataforge/<name> faltantes
|
||||
|
||||
```bash
|
||||
cd /home/egutierrez/fn_registry
|
||||
cd /home/lucas/fn_registry # ajustar al PC
|
||||
|
||||
REPOS=$(find . -name ".git" -type d \
|
||||
-not -path "./.git/*" \
|
||||
-not -path "*/node_modules/*" \
|
||||
@@ -19,10 +20,25 @@ REPOS=$(find . -name ".git" -type d \
|
||||
-not -path "*/cpp/vendor/*" \
|
||||
-not -path "*/cpp/build/*" \
|
||||
-not -path "*/sources/*" \
|
||||
-not -path "*/temp/*" 2>/dev/null | sed 's|/.git$||')
|
||||
-not -path "*/temp/*" \
|
||||
-not -path "*/subrepos/*" 2>/dev/null | sed 's|/.git$||')
|
||||
REPOS=". $REPOS"
|
||||
```
|
||||
|
||||
Despues, despues de `fn sync` (paso 5), hacer **una segunda pasada** para clonar repos `dataforge/<name>` que esten registrados en `pc_locations` o `apps`/`analysis` pero no existan localmente — la metadata vino del API y los repos hay que clonarlos:
|
||||
|
||||
```bash
|
||||
# Listar apps + analysis registradas con dir_path
|
||||
sqlite3 registry.db "SELECT name, dir_path FROM apps WHERE dir_path != '' UNION SELECT name, dir_path FROM analysis WHERE dir_path != '';" | while IFS='|' read name path; do
|
||||
full="$path"
|
||||
if [[ ! -d "$full/.git" && ! -d "$full" ]]; then
|
||||
GITEA_URL=$(pass agentes/gitea-url | head -n1)
|
||||
GITEA_TOKEN=$(pass gitea/dataforge-git-token | head -n1)
|
||||
git clone "https://${GITEA_TOKEN}@${GITEA_URL#https://}/dataforge/${name}.git" "$full" 2>&1 | tail -2
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
### 2. Para cada repo: stash si dirty, pull --ff-only, pop
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user