110 lines
2.9 KiB
Markdown
110 lines
2.9 KiB
Markdown
# AGENT GIT - NetGescon Day-0
|
|
|
|
Data: 10-03-2026
|
|
|
|
## Stato attuale
|
|
|
|
- Backup pre-cutover creato:
|
|
- `storage/backups/cutover-snapshots/netgescon-pre-gitea-cutover-20260310-202545.tar.gz`
|
|
- `storage/backups/cutover-snapshots/netgescon-pre-gitea-cutover-20260310-202545.tar.gz.sha256`
|
|
- Repo Day-0 creato in cartella separata:
|
|
- `/home/michele/netgescon/netgescon-day0`
|
|
- Commit baseline Day-0 presente:
|
|
- `3420e37 chore: NetGescon day-0 baseline 2026-03-10`
|
|
- Protezione anti-errore attivata nel repo storico:
|
|
- remote rinominato da `origin` a `legacy-origin`
|
|
|
|
## Obiettivo
|
|
|
|
Partire da oggi con storico Git pulito e pipeline update ordinata, senza usare il vecchio remoto.
|
|
|
|
## Script pronto
|
|
|
|
Script operativo:
|
|
|
|
- `scripts/ops/netgescon-day0-cutover.sh`
|
|
|
|
Cosa fa:
|
|
|
|
1. Crea copia pulita del progetto in nuova cartella.
|
|
2. Esclude segreti e artefatti (`.env`, `vendor`, `node_modules`, log/cache runtime).
|
|
3. Inizializza Git da zero e crea commit baseline.
|
|
4. Opzionale: crea repo su Gitea via API e fa push.
|
|
|
|
## Avvio Day-0 locale (gia eseguito)
|
|
|
|
```bash
|
|
cd /home/michele/netgescon/netgescon-laravel
|
|
bash scripts/ops/netgescon-day0-cutover.sh \
|
|
--target /home/michele/netgescon/netgescon-day0 \
|
|
--force \
|
|
--message "chore: NetGescon day-0 baseline 2026-03-10"
|
|
```
|
|
|
|
## Cutover completo su Gitea senza UI
|
|
|
|
Richiede solo token API e naming del repo.
|
|
|
|
```bash
|
|
cd /home/michele/netgescon/netgescon-laravel
|
|
bash scripts/ops/netgescon-day0-cutover.sh \
|
|
--source /home/michele/netgescon/netgescon-laravel \
|
|
--target /home/michele/netgescon/netgescon-day0 \
|
|
--force \
|
|
--push \
|
|
--gitea-url https://git.netgescon.it \
|
|
--gitea-token "<TOKEN_API>" \
|
|
--gitea-owner "NetGescon" \
|
|
--gitea-owner-type org \
|
|
--gitea-repo "netgescon"
|
|
```
|
|
|
|
Se l'owner e un utente (non org):
|
|
|
|
- usa `--gitea-owner-type user`
|
|
|
|
## Post-cutover consigliato
|
|
|
|
Nel repo Day-0:
|
|
|
|
```bash
|
|
cd /home/michele/netgescon/netgescon-day0
|
|
git remote -v
|
|
git status
|
|
```
|
|
|
|
Poi imposta protezioni branch su Gitea (`main` protected) e usa solo questo repo per i prossimi update.
|
|
|
|
## Input minimi richiesti all'utente
|
|
|
|
Per completare automaticamente push e creazione repo, servono solo:
|
|
|
|
1. `GITEA_API_TOKEN` (con permesso creazione repo)
|
|
2. `owner` (utente o org)
|
|
3. `repo name` desiderato
|
|
|
|
Tutto il resto e gia pronto.
|
|
|
|
## Blocco attuale e sblocco rapido
|
|
|
|
Stato tecnico verificato:
|
|
|
|
- SSH verso Gitea funziona (`git@192.168.0.53:2222` autenticato).
|
|
- Il repo remoto `michele/netgescon-day0` non esiste ancora.
|
|
- API in basic auth bloccata con messaggio: `Aggiorna la tua password`.
|
|
|
|
Sblocco richiesto (solo una volta):
|
|
|
|
1. Accedi a `http://192.168.0.53:3000` con utente `michele`.
|
|
2. Completa aggiornamento password se richiesto.
|
|
3. Crea repo vuoto `netgescon-day0` senza README, oppure genera token API.
|
|
|
|
Comando finale push Day-0:
|
|
|
|
```bash
|
|
cd /home/michele/netgescon/netgescon-day0
|
|
git remote set-url origin ssh://git@192.168.0.53:2222/michele/netgescon-day0.git
|
|
git push -u origin main
|
|
```
|
|
|