+5
-6
@@ -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
|
||||
|
||||
+14
-7
@@ -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 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user