Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
- Remove middleware reference from Gitea Traefik labels (caused routing issues) - Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s) - Add explicit service reference in Traefik labels - Fix intermittent 504 timeouts by improving PostgreSQL connection handling Fixes Gitea unreachability via git.michaelschiemer.de
215 lines
4.5 KiB
Markdown
215 lines
4.5 KiB
Markdown
# CI/CD Pipeline Test - Schritt-für-Schritt Anleitung
|
|
|
|
**Stand:** 2025-11-07
|
|
**Status:** Gemeinsame Test-Anleitung
|
|
|
|
---
|
|
|
|
## Vorbereitung
|
|
|
|
### Schritt 1: Aktuellen Status prüfen
|
|
|
|
```bash
|
|
# Im Repository-Root
|
|
cd ~/dev/michaelschiemer # oder dein Repository-Pfad
|
|
|
|
# Aktuellen Branch prüfen
|
|
git branch --show-current
|
|
|
|
# Status prüfen
|
|
git status
|
|
```
|
|
|
|
**Erwartet:**
|
|
- Branch: `staging` oder `main` (je nachdem was du testen willst)
|
|
- Keine uncommitted Changes (oder committen vorher)
|
|
|
|
### Schritt 2: Secrets in Gitea prüfen
|
|
|
|
**Öffne im Browser:**
|
|
```
|
|
https://git.michaelschiemer.de/michael/michaelschiemer/settings/secrets/actions
|
|
```
|
|
|
|
**Prüfe ob folgende Secrets vorhanden sind:**
|
|
- ✅ `REGISTRY_USER`
|
|
- ✅ `REGISTRY_PASSWORD`
|
|
- ✅ `SSH_PRIVATE_KEY`
|
|
- ✅ `ANSIBLE_VAULT_PASSWORD`
|
|
|
|
**Falls `ANSIBLE_VAULT_PASSWORD` fehlt:**
|
|
- Erstelle Secret mit dem Vault-Passwort aus `deployment/ansible/secrets/.vault_pass`
|
|
|
|
### Schritt 3: Gitea Runner Status prüfen
|
|
|
|
**Im Browser:**
|
|
```
|
|
https://git.michaelschiemer.de/admin/actions/runners
|
|
```
|
|
|
|
**Erwartet:**
|
|
- Runner sollte als "Idle" oder "Active" angezeigt werden
|
|
|
|
**Oder lokal prüfen:**
|
|
```bash
|
|
cd deployment/gitea-runner
|
|
docker compose ps
|
|
```
|
|
|
|
**Erwartet:**
|
|
- `gitea-runner`: Up
|
|
- `gitea-runner-dind`: Up
|
|
|
|
---
|
|
|
|
## Staging Pipeline Test
|
|
|
|
### Schritt 1: Auf staging Branch wechseln
|
|
|
|
```bash
|
|
cd ~/dev/michaelschiemer # oder dein Repository-Pfad
|
|
git checkout staging
|
|
git pull origin staging
|
|
```
|
|
|
|
### Schritt 2: Test-Commit erstellen
|
|
|
|
```bash
|
|
# Kleine Änderung
|
|
echo "# Test CI/CD Pipeline - $(date)" >> README.md
|
|
|
|
# Committen
|
|
git add README.md
|
|
git commit -m "test: CI/CD pipeline test"
|
|
|
|
# Pushen (triggert automatisch Pipeline)
|
|
git push origin staging
|
|
```
|
|
|
|
### Schritt 3: Pipeline beobachten
|
|
|
|
**Öffne im Browser:**
|
|
```
|
|
https://git.michaelschiemer.de/michael/michaelschiemer/actions
|
|
```
|
|
|
|
**Erwartete Jobs:**
|
|
1. **changes** - Prüft ob Build notwendig ist
|
|
2. **test** - Führt Tests aus (falls changes = true)
|
|
3. **build** - Baut Docker Image (falls changes = true)
|
|
4. **deploy-staging** - Deploy zu Staging (automatisch bei staging Branch)
|
|
|
|
**Beobachte jeden Job:**
|
|
- Klicke auf den Job
|
|
- Prüfe die Logs
|
|
- Notiere Fehler falls welche auftreten
|
|
|
|
### Schritt 4: Verifikation auf Server
|
|
|
|
**Nach erfolgreichem Pipeline-Lauf:**
|
|
|
|
```bash
|
|
# SSH zum Server
|
|
ssh deploy@94.16.110.151
|
|
|
|
# Code-Deployment prüfen
|
|
cd /home/deploy/michaelschiemer/current
|
|
git log -1 # Sollte Test-Commit zeigen
|
|
|
|
# Composer Dependencies prüfen
|
|
docker compose -f ~/deployment/stacks/production/docker-compose.base.yml \
|
|
-f ~/deployment/stacks/production/docker-compose.production.yml \
|
|
exec php test -f /var/www/html/vendor/autoload.php && echo "EXISTS" || echo "MISSING"
|
|
|
|
# Container Status prüfen
|
|
docker compose -f ~/deployment/stacks/production/docker-compose.base.yml \
|
|
-f ~/deployment/stacks/production/docker-compose.production.yml ps
|
|
|
|
# Health-Check
|
|
curl -f https://staging.michaelschiemer.de/health
|
|
```
|
|
|
|
---
|
|
|
|
## Production Pipeline Test
|
|
|
|
**Wichtig:** Nur nach erfolgreichem Staging-Test!
|
|
|
|
### Schritt 1: Auf main Branch wechseln
|
|
|
|
```bash
|
|
cd ~/dev/michaelschiemer
|
|
git checkout main
|
|
git pull origin main
|
|
```
|
|
|
|
### Schritt 2: Test-Commit erstellen
|
|
|
|
```bash
|
|
# Kleine Änderung
|
|
echo "# Test CI/CD Pipeline Production - $(date)" >> README.md
|
|
|
|
# Committen
|
|
git add README.md
|
|
git commit -m "test: CI/CD pipeline production test"
|
|
|
|
# Pushen (triggert automatisch Pipeline)
|
|
git push origin main
|
|
```
|
|
|
|
### Schritt 3: Pipeline beobachten
|
|
|
|
**Gleiche Schritte wie Staging:**
|
|
- Pipeline in Gitea Actions UI beobachten
|
|
- Jobs prüfen
|
|
- Logs analysieren
|
|
|
|
### Schritt 4: Verifikation auf Server
|
|
|
|
**Gleiche Checks wie Staging, aber Production URL:**
|
|
```bash
|
|
curl -f https://michaelschiemer.de/health
|
|
```
|
|
|
|
---
|
|
|
|
## Fehlerbehebung
|
|
|
|
### Problem: Pipeline startet nicht
|
|
|
|
**Prüfe:**
|
|
1. Runner läuft: `docker compose ps` in `deployment/gitea-runner`
|
|
2. Runner in Gitea UI sichtbar
|
|
3. Workflow-Datei korrekt
|
|
|
|
### Problem: Code-Deployment schlägt fehl
|
|
|
|
**Prüfe:**
|
|
1. `deploy-application-code.yml` Logs in Gitea Actions
|
|
2. Git Repository existiert auf Server
|
|
3. Branch-Name korrekt
|
|
|
|
### Problem: Image-Deployment schlägt fehl
|
|
|
|
**Prüfe:**
|
|
1. Registry Login erfolgreich
|
|
2. Image existiert in Registry
|
|
3. `deploy-image.yml` Logs
|
|
|
|
### Problem: Health-Check schlägt fehl
|
|
|
|
**Prüfe:**
|
|
1. Container Status: `docker compose ps`
|
|
2. Container Logs: `docker compose logs`
|
|
3. Health-Check Endpoint: `curl https://michaelschiemer.de/health`
|
|
|
|
---
|
|
|
|
## Nächste Schritte
|
|
|
|
Nach erfolgreichem Test:
|
|
1. Fehler dokumentieren (falls welche aufgetreten sind)
|
|
2. CI/CD Status aktualisieren
|
|
3. Production-Deployment für echte Features verwenden
|
|
|