From cb88fb52f1ca7c3607489ad192c6cbcb2ddf2d40 Mon Sep 17 00:00:00 2001 From: Luca Banfi Date: Mon, 18 May 2026 15:29:48 +0200 Subject: [PATCH] woodpecker update --- .woodpecker.yml | 11 +++++------ Docs/autodeploy.md | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1f5e9c3..f91c164 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -10,13 +10,13 @@ # git tag prod && git push --tags when: - event: [push, pull_request, tag] + event: [push, pull_request, tag, manual] steps: - name: lint image: python:3.12-slim when: - event: [push, pull_request, tag] + event: [push, pull_request, tag, manual] commands: - pip install flake8 --quiet - flake8 . --max-line-length=120 --exclude=__pycache__ @@ -24,7 +24,7 @@ steps: - name: syntax image: python:3.12-slim when: - event: [push, pull_request, tag] + event: [push, pull_request, tag, manual] depends_on: [lint] commands: - pip install python-dotenv --quiet @@ -33,7 +33,7 @@ steps: - name: build image: python:3.12-slim when: - event: tag + event: [tag, manual] tag: prod commands: - apt-get update -qq && apt-get install -y zip --quiet @@ -79,8 +79,7 @@ steps: - name: deploy image: docker:cli when: - event: tag - tag: prod + event: [tag, manual] depends_on: [build] volumes: - /ATG_RUN_TEST/Dashboard:/app diff --git a/Docs/autodeploy.md b/Docs/autodeploy.md index 9ca10fd..e8f52ef 100644 --- a/Docs/autodeploy.md +++ b/Docs/autodeploy.md @@ -22,28 +22,35 @@ tag prod → lint → syntax → build → deploy ## 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 +# 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 | Trigger | Cosa fa | -|---|---|---| -| `lint` | push / PR / tag | flake8 — controlla stile e errori Python | -| `syntax` | push / PR / tag | `py_compile` su tutti i `.py` | -| `build` | tag `prod` | crea `rpa-tdi-dashboard-prod.zip` (esclude `.env`, `__pycache__`, `*.md`, ecc.) | -| `deploy` | tag `prod` | estrae lo zip in `/ATG_RUN_TEST/Dashboard`, riavvia il container | +| 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 | ---