Deploy Staging
Scopo
Promuovere codice validato da dev a staging e verificare l’ambiente cliente.
Prerequisiti
- PR
dev→stagingcon CI verde. - Secrets:
BACKUP_WEBHOOK_STAGING(URL Control/api/webhooks/backup/staging?token=…),DOKPLOY_WEBHOOK_STAGING,COOLIFY_DEPLOY_TOKEN. - Node-RED staging opzionale ma consigliato per test macchine.
Trigger
Merge PR su staging → build-image.yml (test + push GHCR) → deploy-staging.yml.
Procedura automatica
- Backup pre-deploy (webhook obbligatorio).
- Deploy immagine
ghcr.io/<org>/ez-factoryos:sha-<commit>/:staging. configuratoreseguebench migrate.- Health check (
scripts/health-check.sh). - Applicare
scripts/staging-safety.shse non già eseguito.
Procedura manuale (server)
bash
docker compose -f deploy/compose/staging.yml --env-file deploy/env/.env.staging pull
docker compose -f deploy/compose/staging.yml --env-file deploy/env/.env.staging up -d
docker compose -f deploy/compose/staging.yml --env-file deploy/env/.env.staging exec backend \
bash -lc 'cd /home/frappe/frappe-bench && bench --site <site> migrate'
bash scripts/staging-safety.sh
bash scripts/health-check.shSu Coolify: usare i manifest coolify.staging.yml generati.
Verifica
bash
curl -fsS https://staging-factoryos.ezbit.it/api/method/ping
# mute_emails=1; Business Cube URL vuoto; OT writes offSmoke Desk: login, Work Order, Machine Connection Profile.
Rollback
Vedi infrastructure/rollback.
