# RPA Dashboard — Autodeploy con Woodpecker CI ## Panoramica Il deploy avviene automaticamente tramite **Woodpecker CI** collegato a **Gitea**. Non serve nessun intervento manuale: basta taggare un commit con `prod`. --- ## Flusso ``` push / PR → lint + syntax check (verifica automatica ad ogni commit) tag prod → lint → syntax → build → deploy └─ estrae i file su /ATG_RUN_TEST/Dashboard └─ riavvia il container Docker └─ dashboard live su http://57.131.52.95:8473 ``` --- ## Pubblicare una nuova versione ### Automatico — tag `prod` (raccomandato) ```bash # 1. Commit delle modifiche git add . git commit -m "descrizione modifica" # 2. Spostare il tag prod sul commit corrente e pubblicare git tag -f prod git push --force --tags ``` Woodpecker riceve il webhook da Gitea e avvia la pipeline in automatico. ### Manuale — dal pannello Woodpecker Apri la pipeline su Woodpecker UI → pulsante **"trigger manually"**. Esegue build + deploy senza bisogno di taggare (utile per test o fix rapidi). --- ## Step della pipeline (`.woodpecker.yml`) | Step | push / PR | tag `prod` | manuale | Cosa fa | |---|---|---|---|---| | `lint` | ✓ | ✓ | ✓ | flake8 — controlla stile e errori Python | | `syntax` | ✓ | ✓ | ✓ | `py_compile` su tutti i `.py` | | `build` | — | ✓ | ✓ | crea `rpa-tdi-dashboard-prod.zip` (esclude `.env`, `__pycache__`, `*.md`, ecc.) | | `deploy` | — | ✓ | ✓ | estrae lo zip in `/ATG_RUN_TEST/Dashboard`, riavvia il container | --- ## Infrastruttura | Componente | Dettaglio | |---|---| | Forge | Gitea (self-hosted) | | CI | Woodpecker CI — Ubuntu cloud + Docker | | VM | `57.131.52.95` | | Porta dashboard | `8473` | | Cartella deploy | `/ATG_RUN_TEST/Dashboard` | | Cartella DB | `/ATG_RUN_TEST/db` | | Container | `rpa-dashboard-test` | --- ## Prerequisiti sulla VM (setup iniziale, una tantum) ```bash # Creare le cartelle mkdir -p /ATG_RUN_TEST/Dashboard mkdir -p /ATG_RUN_TEST/db # Creare il .env con le variabili locali Linux cat > /ATG_RUN_TEST/Dashboard/.env <