Files
michaelschiemer/deployment/DEPLOYMENT-TODO.md

8.9 KiB

Deployment TODO - Komplette Implementierung

Status: 🔄 In Progress
Letzte Aktualisierung: 2025-10-31
Ziel: Komplettes Deployment-Setup im deployment/ Ordner


Bereits Fertig

Infrastructure Stacks (deployed via Ansible)

  • Traefik - Reverse Proxy & SSL
  • PostgreSQL - Database Stack
  • Docker Registry - Private Registry
  • Gitea - Git Server + MySQL + Redis
  • Monitoring - Portainer + Grafana + Prometheus
  • WireGuard VPN - VPN Server

Ansible Playbooks

  • setup-infrastructure.yml - Infrastructure Stacks Deployment
  • setup-wireguard.yml - WireGuard VPN Setup
  • add-wireguard-client.yml - WireGuard Client hinzufügen
  • deploy-update.yml - Application Update Deployment
  • rollback.yml - Rollback zu vorheriger Version
  • setup-production-secrets.yml - Secrets Deployment
  • setup-ssl-certificates.yml - SSL Certificate Setup
  • sync-stacks.yml - Stacks synchronisieren

Dokumentation

  • README.md - Deployment Übersicht
  • SETUP-GUIDE.md - Komplette Setup-Anleitung
  • DEPLOYMENT-STATUS.md - Aktueller Status
  • docs/WIREGUARD-SETUP.md - WireGuard Dokumentation

Offene Aufgaben

1. Application Stack Integration

Status: ⚠️ Fehlt in setup-infrastructure.yml

Was fehlt:

  • Application Stack zu setup-infrastructure.yml hinzufügen
  • .env Template für Application Stack erstellen (application.env.j2)
  • Ansible Playbook/Task für Application Stack Deployment
  • Database-Migration nach Application Deployment
  • Health-Check nach Application Deployment

Dateien:

  • deployment/stacks/application/docker-compose.yml Vorhanden
  • deployment/stacks/application/.env.example Vorhanden
  • deployment/stacks/application/.env Fehlt (muss generiert werden)
  • deployment/ansible/templates/application.env.j2 Fehlt (Template für .env)
  • deployment/ansible/playbooks/setup-infrastructure.yml ⚠️ Application fehlt

Nächste Schritte:

  1. Application Stack Deployment Task zu setup-infrastructure.yml hinzufügen
  2. .env Template erstellen (mit Passwörtern aus Vault)
  3. Database-Migration nach Application Start
  4. Health-Check Integration

2. Application Stack .env Konfiguration

Status: Erledigt

Was erledigt:

  • Ansible Template für .env Datei erstellt (application.env.j2)
  • Passwörter aus Vault/PostgreSQL .env laden
  • Domain-Konfiguration aus Inventory
  • Environment-Variablen aus Vault/Template generieren

Dateien:

  • deployment/stacks/application/.env.example Vorhanden (angepasst für PostgreSQL)
  • deployment/stacks/application/.env ⚠️ Wird automatisch generiert
  • deployment/ansible/templates/application.env.j2 Erstellt
  • deployment/stacks/application/docker-compose.yml Angepasst (PostgreSQL statt MySQL)

3. Gitea Runner Setup abschließen

Status: Wartet auf Registration Token

Was fehlt:

Dateien:

  • deployment/gitea-runner/.env ⚠️ Vorhanden, aber Token fehlt
  • deployment/gitea-runner/.env.example Vorhanden

Nächste Schritte:

  1. Gitea Actions aktivieren (Admin Panel)
  2. Runner Registration Token generieren
  3. Token in .env eintragen
  4. Runner starten: cd deployment/gitea-runner && docker compose up -d

4. CI/CD Pipeline finalisieren

Status: ⚠️ Existiert, aber muss konfiguriert und getestet werden

Was fehlt:

  • Gitea Repository Secrets konfigurieren:
    • REGISTRY_USER (Docker Registry Benutzername)
    • REGISTRY_PASSWORD (Docker Registry Passwort)
    • SSH_PRIVATE_KEY (SSH Private Key für Production-Server)
    • GITEA_TOKEN (Optional: Für automatische Issue-Erstellung)
  • Gitea Runner registrieren:
    • Registration Token von Gitea Admin Panel abgerufen
    • Token in deployment/gitea-runner/.env eingetragen
    • Runner registriert
    • Runner läuft
  • Pipeline End-to-End testen:
    • Test-Commit pushen oder Workflow manuell triggern
    • Alle Jobs erfolgreich (Tests, Build, Deploy)
    • Deployment erfolgreich auf Production
    • Health-Check erfolgreich

Dateien:

  • .gitea/workflows/production-deploy.yml Vorhanden
  • .gitea/workflows/update-production-secrets.yml Vorhanden
  • .gitea/workflows/security-scan.yml Vorhanden
  • deployment/CI_CD_STATUS.md Neu erstellt (detaillierte Checkliste)

Detaillierte Anleitung: Siehe deployment/CI_CD_STATUS.md für komplette Checkliste und Setup-Anleitung.

Nächste Schritte:

  1. Secrets in Gitea konfigurieren:
    • Gehe zu: https://git.michaelschiemer.de/michael/michaelschiemer/settings/secrets/actions
    • Füge Secrets hinzu: REGISTRY_USER, REGISTRY_PASSWORD, SSH_PRIVATE_KEY
  2. Gitea Runner registrieren:
    • Token von: https://git.michaelschiemer.de/admin/actions/runners
    • Konfiguriere deployment/gitea-runner/.env
    • Führe ./register.sh aus
  3. Pipeline testen:
    • Workflow manuell triggern oder Test-Commit pushen
    • Logs beobachten und Fehler beheben

5. Backup & Rollback Scripts

Status: ⚠️ Teilweise vorhanden

Was fehlt:

  • Backup-Playbook für Application Stack
  • Rollback-Playbook testen und finalisieren
  • PostgreSQL Backup-Integration
  • Gitea Data Backup
  • Registry Images Backup

Dateien:

  • deployment/ansible/playbooks/rollback.yml Vorhanden
  • deployment/scripts/rollback.sh Vorhanden
  • deployment/stacks/postgresql/scripts/backup.sh Vorhanden
  • deployment/ansible/playbooks/backup.yml Fehlt

Nächste Schritte:

  1. Backup-Playbook erstellen
  2. Rollback-Playbook testen
  3. Backup-Scripte finalisieren
  4. Automatisierte Backups konfigurieren

6. Deployment Scripts finalisieren

Status: ⚠️ Vorhanden, aber muss angepasst werden

Was fehlt:

  • deployment/scripts/deploy.sh testen und anpassen
  • deployment/scripts/rollback.sh testen und anpassen
  • deployment/scripts/setup-production.sh finalisieren
  • Scripts für alle Stacks (nicht nur Application)

Dateien:

  • deployment/scripts/deploy.sh Vorhanden (aber Docker Swarm statt Compose?)
  • deployment/scripts/rollback.sh Vorhanden
  • deployment/scripts/setup-production.sh Vorhanden

Nächste Schritte:

  1. Scripts prüfen und anpassen (Docker Compose statt Swarm)
  2. Scripts testen
  3. Integration mit Ansible Playbooks

7. Dokumentation vervollständigen

Status: ⚠️ Gut, aber einige Updates nötig

Was fehlt:

  • DEPLOYMENT-STATUS.md aktualisieren (Application Stack Status)
  • README.md aktualisieren (Application Stack Deployment)
  • SETUP-GUIDE.md aktualisieren (Application Stack Phase)
  • Troubleshooting Guide für Application Stack

Dateien:

  • deployment/README.md ⚠️ Muss aktualisiert werden
  • deployment/SETUP-GUIDE.md ⚠️ Muss aktualisiert werden
  • deployment/DEPLOYMENT-STATUS.md ⚠️ Muss aktualisiert werden

🎯 Priorisierte Reihenfolge

Phase 1: Application Stack Deployment (KRITISCH)

  1. Application Stack zu setup-infrastructure.yml hinzufügen

    • Task für Application Stack Deployment
    • .env Template erstellen
    • Database-Migration nach Deployment
  2. Application .env Konfiguration

    • Template application.env.j2 erstellen
    • Passwörter aus Vault laden
    • Template in Playbook integrieren

Phase 2: CI/CD Setup

  1. Gitea Runner Setup abschließen

    • Token abrufen und konfigurieren
    • Runner starten
  2. CI/CD Pipeline finalisieren

    • Secrets in Gitea konfigurieren
    • Pipeline testen

Phase 3: Backup & Scripts

  1. Backup & Rollback Scripts

    • Backup-Playbook erstellen
    • Rollback testen
  2. Deployment Scripts finalisieren

    • Scripts testen und anpassen

Phase 4: Dokumentation

  1. Dokumentation aktualisieren
    • README aktualisieren
    • Status-Dokumente aktualisieren

📋 Quick Checklist

Application Stack

  • Application Stack in setup-infrastructure.yml hinzufügen
  • .env Template (application.env.j2) erstellen
  • Database-Migration Task hinzufügen
  • Health-Check nach Deployment

CI/CD

  • Gitea Runner Token konfigurieren
  • Runner starten
  • Secrets in Gitea konfigurieren
  • Pipeline testen

Scripts & Backup

  • Backup-Playbook erstellen
  • Rollback testen
  • Deployment-Scripts finalisieren

Dokumentation

  • README aktualisieren
  • SETUP-GUIDE aktualisieren
  • DEPLOYMENT-STATUS aktualisieren

Nächster Schritt: Application Stack zu setup-infrastructure.yml hinzufügen und .env Template erstellen