Commit Graph

186 Commits

Author SHA1 Message Date
0c7b96e887 fix(ci): Fix workflow job dependencies and execution flow
- Removed runtime-base from build job dependencies (build now only depends on changes)
- runtime-base now only runs when needed (if needs_runtime_build or needs_build is true)
- build job now handles missing runtime-base outputs gracefully
- deploy-staging and deploy-production now only depend on build (not runtime-base)
- Added always() conditions to ensure jobs run even if previous jobs are skipped
- Fixes issue where workflow stopped after runtime-base job when build was skipped
2025-11-01 21:21:58 +01:00
13e12487d7 fix(ci): Fix RUNTIME_IMAGE_NAME variable substitution in runtime-base job
- Added RUNTIME_IMAGE_NAME to env section of Build and push runtime base image step
- Added RUNTIME_IMAGE_NAME to env section of Set runtime base outputs step
- Fixes 'bad substitution' error when variable is used in shell scripts
2025-11-01 21:17:44 +01:00
a52142f304 chore: Update Dockerfiles, Makefile and documentation
- Updated Dockerfile.production
- Updated Makefile
- Updated deployment documentation
- Updated docker/ci/Dockerfile, docker/php/Dockerfile, docker/worker/Dockerfile
- Updated dependency scanning documentation
- Added git-hooks documentation
2025-11-01 21:16:03 +01:00
e68d1917b0 refactor(ci): Consolidate workflows and fix Git sync
- Added explicit Git pull in staging deployment after container restart
- Added production auto-deploy job to build-image.yml (for main branch)
- Removed redundant workflows: deploy-staging.yml, deploy-production.yml, production-deploy.yml
- All deployments now handled by build-image.yml:
  - staging branch → auto-deploy to staging
  - main branch → auto-deploy to production
- Fixed build job dependency (removed test dependency)
- Git sync now explicitly pulls code after deployment to ensure containers are up-to-date
2025-11-01 21:15:00 +01:00
d14d768acd fix(ci): Remove test dependency from build job to fix workflow execution
- Removed 'test' from build job needs array
- Build job now depends only on [changes, runtime-base]
- Fixes issue where build was waiting for skipped test job
- deploy-staging now correctly waits for build completion
2025-11-01 21:07:02 +01:00
9e34c0b474 fix: Verbessere Staging Deployment - Code-Synchronisation
- Aktualisiere docker-compose.yml immer aus Repository
- Starte staging-app Container neu für Git-Pull
- Unterstütze mehrere Image-URL-Formate in sed-Replacements
- Füge Wartezeiten für Git-Sync hinzu
- Behebt Problem, dass Code nicht synchronisiert wurde
2025-11-01 20:57:33 +01:00
8381651876 fix: Korrigiere Nginx PHP-FPM Upstream-Konfiguration für Staging
- Fix upstream configuration in staging-nginx container
- Verbessere sed-Befehle zur automatischen Korrektur der PHP-FPM Upstream-Definition
- Behebt 502 Bad Gateway Fehler durch korrekte Verbindung zu staging-app:9000
2025-11-01 20:43:42 +01:00
2d99a23286 feat: add system maintenance automation 2025-11-01 19:56:42 +01:00
b76064d94a fix: stabilise staging sync 2025-11-01 19:42:27 +01:00
5a79646daf chore: sync staging workspace 2025-11-01 19:02:09 +01:00
478754ab02 chore: clean up and rename workflows 2025-11-01 17:24:20 +01:00
225c7c43f9 fix: declare runtime image arg in dockerfile 2025-11-01 17:08:21 +01:00
6bf6bf4cbe ci: optimise docker workflows 2025-11-01 17:04:03 +01:00
46f17c5164 fix: staging-app should only run PHP-FPM (not nginx) + fix git ownership warnings 2025-11-01 16:03:22 +01:00
210e0aa74d feat: add auto-deploy to staging after successful build 2025-11-01 15:50:52 +01:00
a441da37f6 feat: implement exception handling system with error context and policies 2025-11-01 15:46:43 +01:00
f3440dff0d Merge staging: Fix security-scan workflow and ErrorAggregationInitializer 2025-11-01 00:31:11 +01:00
9591ecc906 fix: Update security-scan.yml (additional fixes) 2025-11-01 00:31:09 +01:00
2e8797ce1d fix: Correct branch detection in security-scan.yml
- Handle pull_request events correctly (use head_ref)
- Support staging branch in security scans
- Add workflow_dispatch input for branch selection
- Fix REF_NAME extraction for all event types
2025-11-01 00:29:34 +01:00
e105afb23c fix: Update DefaultContainer if needed 2025-11-01 00:28:33 +01:00
d2b7fc96fc fix: Update ErrorAggregationInitializer
Fix DI binding issues for ErrorAggregatorInterface
2025-11-01 00:25:13 +01:00
8c7bbec8b7 fix: Correct staging-internal network configuration
Remove external: false and name specification to let Docker Compose
create the network automatically
2025-10-31 23:58:14 +01:00
87aa6f067e Merge staging: Add staging environment setup 2025-10-31 23:52:43 +01:00
77b2dc5dd7 feat: Add staging environment setup
- Create staging stack with separate containers and volumes
- Configure staging.michaelschiemer.de subdomain routing
- Add deploy-staging.yml workflow for auto-deployment
- Extend build-image.yml to support staging branch
- Separate Redis instance and network for staging
- Staging uses staging branch by default

Features:
- Auto-deploy: Push to staging branch → build → deploy to staging
- Separate from production: Different containers, volumes, networks
- Shared Traefik: Uses same SSL certificates (*.michaelschiemer.de)
- Testing environment before production deployment
2025-10-31 23:52:30 +01:00
bb0caa4e7c chore: Trigger build workflow test
Testing the new separated build-image.yml workflow
2025-10-31 23:44:48 +01:00
194bd71257 feat: Split CI/CD pipeline into separate build and deploy workflows
- Add build-image.yml: Automatic image builds on push (5-8 min)
- Add deploy-production.yml: Manual deployment workflow (2-5 min)
- Mark production-deploy.yml as deprecated

Benefits:
- Faster feedback: Images ready in ~5-8 min (vs 10-15 min before)
- Flexible deployment: Deploy when ready, not forced after every build
- Parallel execution: Multiple builds can run simultaneously
- Better separation: Build failures don't block deployments of existing images
2025-10-31 23:43:49 +01:00
d84c5dbacb refactor: Framework code cleanup and improvements
- DI dependency graph improvements
- Database connection updates
- HTTP middleware chain optimizations
- Routing middleware cleanup
2025-10-31 23:38:23 +01:00
dd5c1687e3 fix: Update nginx upstream name from php-fpm to php-upstream
Ensure consistency with nginx base image configuration
2025-10-31 23:38:13 +01:00
01fcd690e2 feat: Shared code volume for nginx and app containers
- Add app-code volume to both nginx and app containers
- App container clones code once into shared volume
- Nginx container uses shared volume (read-only) and waits for code
- Update entrypoint.sh to handle storage-preserving git clone
- Fix nginx configuration to use app:9000 for PHP-FPM

This eliminates duplicate code cloning and ensures both containers
always use the same code version from the shared volume.
2025-10-31 23:37:29 +01:00
9e39a7b14e chore: Make RapidMail Credentials non required. 2025-10-31 23:34:36 +01:00
6c7f27dae4 fix: add fallback for empty image_tag in deployment
- Add validation and fallback logic for IMAGE_TAG
- If build job output is empty, generate tag from commit SHA
- Use 'latest' tag as last resort fallback
- Add debug output to show what tag is being used
- Fixes 'invalid reference format' error when IMAGE_TAG is empty
2025-10-31 22:16:50 +01:00
2373060d3f refactor: replace Ansible deployment with direct SSH commands
- Remove Ansible dependency from deployment workflow
- Use direct SSH commands for Docker operations
- Simplify deployment process:
  * SSH to production server
  * Docker registry login
  * Pull new image
  * Update docker-compose.yml with sed
  * Restart services with docker compose
- Remove Ansible verification step
- Simplify rollback step (only shows manual instructions)
- Works with ubuntu-latest runner (no special image needed)
- Fixes 'ansible: command not found' errors
- Works with act for local testing
2025-10-31 22:08:00 +01:00
798eea093a feat: add act configuration for local workflow testing
- Add .actrc file to map custom runner labels to Docker images
- Add test-workflow.sh script for easy local testing with act
- Maps php-ci runner to php-ci:latest Docker image
- Maps docker-build runner to docker:latest
- Helps resolve 'ansible: command not found' errors when testing workflows locally
2025-10-31 22:00:09 +01:00
e9f0847b1e fix: use php-ci runner for deploy job instead of ubuntu-latest
- Changed deploy job to use php-ci runner which has Ansible pre-installed
- Removed redundant Ansible installation step
- Fixes 'ansible: command not found' error in Gitea Actions workflow
2025-10-31 21:50:37 +01:00
d14d12be3a test: Second workflow test - Buildx configuration fix 2025-10-31 21:33:19 +01:00
12cc4b3617 fix: Use DOCKER_HOST from runner environment for Buildx
- Remove hardcoded docker-dind host reference
- Buildx will use DOCKER_HOST from runner environment
- Add Docker availability check
- Improve error handling for Docker connection
2025-10-31 21:31:57 +01:00
30ab5b4270 test: Trigger workflow to test build optimization 2025-10-31 21:29:43 +01:00
9fd9875611 feat: Skip Docker build if image already exists for commit
- Add check step to verify if image for commit SHA already exists
- Skip build step if image exists (saves 5+ minutes per deployment)
- Use git-{SHORT_SHA} tag to identify images by commit
- Only rebuild when code actually changed
- Improve build cache utilization
2025-10-31 21:26:56 +01:00
8fb2736a07 fix: Prioritize HTTPS registry and configure Buildx for insecure registry
- Prioritize registry.michaelschiemer.de (HTTPS) over HTTP endpoints
- Configure Buildx to use docker-dind with insecure-registry support
- Ensure Buildx respects insecure-registry settings from docker-dind
- Fix 'http: server gave HTTP response to HTTPS client' error
2025-10-31 21:22:55 +01:00
aabb5a82fe fix: Update repository URL in all workflow files
- Fix checkout URLs in update-production-secrets.yml
- Fix checkout URLs in security-scan.yml
- Fix checkout URLs in test-registry.yml
- Change from repository.michaelschiemer.de:5000 to git.michaelschiemer.de
2025-10-31 21:15:01 +01:00
75e2d9e02f fix: Remove duplicate registry validation code
- Remove duplicate ACTUAL_REGISTRY validation logic
- Ensure REGISTRY_TO_USE is properly set before docker build
- Fix invalid tag format error by using consistent variable
2025-10-31 21:14:13 +01:00
16d586ecdf chore: Update deployment configuration and documentation
- Update Gitea configuration (remove DEFAULT_ACTIONS_URL)
- Fix deployment documentation
- Update Ansible playbooks
- Clean up deprecated files
- Add new deployment scripts and templates
2025-10-31 21:11:11 +01:00
cf4748f8db fix: Use correct Git repository URL in checkout steps
- Change from repository.michaelschiemer.de:5000 to git.michaelschiemer.de
- Remove port 5000 from HTTPS URLs (HTTPS uses default port 443)
- Fix TLS handshake error during checkout
2025-10-31 21:05:07 +01:00
0ffea7aaf9 fix: Docker image tag format - remove leading slashes from registry URL
- Add validation and cleanup for ACTUAL_REGISTRY variable
- Remove leading/trailing slashes from registry URLs
- Use REGISTRY_TO_USE variable with fallback to REGISTRY env
- Fix invalid tag format '/framework:latest' error
2025-10-31 21:03:10 +01:00
813cf32b9a Revert: Zurück zu git.michaelschiemer.de da repository.michaelschiemer.de:5000 nicht erreichbar 2025-10-31 20:31:56 +01:00
1107f84f42 Revert: Zurück zu git.michaelschiemer.de da repository.michaelschiemer.de:5000 nicht erreichbar 2025-10-31 20:28:01 +01:00
f1329433ce Update: Verwende repository.michaelschiemer.de:5000 für Git-Repository URLs
- Ändere Remote-URL zu repository.michaelschiemer.de:5000
- Aktualisiere alle Workflows (production-deploy, test-registry, security-scan, update-production-secrets)
- Test: Production Deployment Workflow
2025-10-31 20:14:41 +01:00
891508f47c Fix: Ansible group_vars werden jetzt automatisch geladen
- Erstelle Symlink für inventory/group_vars/production.yml
- Ansible lädt group_vars automatisch, wenn sie neben der Inventory-Datei liegen
- Entferne manuelle include_vars Aufrufe (werden später bereinigt)
- Test: Production Deployment Workflow
2025-10-31 20:11:40 +01:00
9f43d156d8 Add: Test-Workflow für Registry-Credentials
- Testet Registry-Login mit Gitea Secrets
- Vergleicht mit bekannten korrekten Credentials
- Zeigt detaillierte Debug-Informationen
2025-10-31 18:23:25 +01:00
a8f1735f29 Fix: Verbesserte Docker Login-Behandlung für HTTP-Registries
- Prüft HTTPS-Fehler und gibt Hinweise
- Versucht Login erneut falls HTTPS-Probleme erkannt werden
2025-10-31 18:19:50 +01:00