Adds Gitea Actions CI/CD for test and production
The pipeline runs lint, format, tests, build, dependency audit and Lighthouse (mobile and desktop, Playwright Chromium on the arm64 runner) on every pull request, push to master and manual run. Pushes to master deploy to test automatically, and any branch can be deployed to test manually. Test is a Raspberry Pi with nginx next to the current WordPress site; the deploy refuses folders containing WordPress. Production deploys are manual and only from release/* branches, over FTP with TLS to the IIS webhost. The IIS web.config and both nginx configs are generated from the same security header list as the Vite servers, with a test that fails when the generated files drift. Adds .gitattributes for LF line endings and pins pnpm through packageManager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -474,3 +474,147 @@ Verder heb ik de vraag ook beantwoord"
|
||||
**Context**: CONSTRUCTION - Build and Test; awaiting Operations decision
|
||||
|
||||
---
|
||||
|
||||
## Operations - Decision and Deployment Setup Start
|
||||
|
||||
**Timestamp**: 2026-10-18T15:06:16Z
|
||||
|
||||
**User Input**: "commit de huidige changes en ga verder met de Operations Fase. We moeten in ieder geval de CI/CD opzetten. En misschien dat ik meteen logging an monitoring wel toevoegen"
|
||||
|
||||
**AI Response**: "Committed on feature/frontend-shell (not pushed): 4d6408b (code) and 069c7cb (AI-DLC docs). Operations Configuration set to Yes (Decided At: Build and Test); active-features status Operations. Context: self-hosted Gitea at gitea.slpsoftware.nl, no CI config, empty api/, core.autocrlf=true without .gitattributes (CRLF vs Prettier LF risk). Created operations/plans/deployment-setup-plan.md with 8 questions (inclusion, CI system, runner, hosting, environments, trigger, Lighthouse in pipeline, rollback); .gitattributes eol=lf pre-decided."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting answers
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Answers and Clarification
|
||||
|
||||
**Timestamp**: 2026-10-18T19:05:12Z
|
||||
|
||||
**User Input**: "Ik heb de vragen beantwoord"
|
||||
|
||||
**AI Response**: "Read deployment-setup-plan.md answers: A | A | A | X, voor productie wordt dat een webhoster met ftp/sftp toegang. Voor de testomgeving heb ik een eigen server, maar heb ik eventueel ook toegang met ftp/sftp. Ik heb alleen maar 1 website die ik kan hosten dus zodra ik de API ga bouwen die uit een ander project gaat komen moet de website als static files worden geserveerd door de API. Dit is een pagina met meer info over de webhost: https://www.mijnhostingpartner.nl/pg/info/aspnet-core-hosting/ en het gaat dan om het ASP.NET Core 10 Hosting pakket | B | B, ik wil de gitflow gaan toepassen. Naar test moet altijd kunnen. Zodat er makkelijk en snel een specifieke versie op de test-omgeving gedeployed of geredeployed kan worden. Naar productie mag alleen vanaf een release-branch. DIe branch wordt daarna teruggemerged naar develop en master en op master wordt dan een tag gezet. Ik heb ook van trunk-based gehoord. het zou kunnen dat dat praktischer is. Ik laat mij graag aanbevelen wat handiger is voor mij. | ik heb een headless browser op de gitea/buildserver staan. Als het goed is is dat chrome, maar niet meer helemaal zeker. | B als dat kan en ook gezien de database. Ik weet niet of er via de pipeline een migratie kan worden gedaan en ook terug worden gedraaid zodra we een API hebben?. Fetched hosting package page (Windows 2016/2019, URL Rewrite = IIS, 1 website, MSSQL/MySQL/MariaDB 50MB; FTP/SFTP not mentioned). Created operations/plans/deployment-clarification-questions.md: branching strategy (recommend trunk-based with release tags), go-live timing (first prod deploy replaces current site), transfer method to host, test server OS, Chromium in runner; plus info on EF Core migrations and roll-forward rollback."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting clarification answers
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Clarifications and Artifacts
|
||||
|
||||
**Timestamp**: 2026-10-18T19:27:28Z
|
||||
|
||||
**User Input**: "ik heb de vragen beantwoord"
|
||||
|
||||
**AI Response**: "Clarification answers: CQ1 X (master + feature/* + release/*, no develop; PR merge auto-deploys to test; manual test deploy from any branch), CQ2 A (current site on other host, go-live by DNS switch), CQ3 B (FTPS; hoster KB: port 21, TLS, wwwroot), CQ4 B (Raspberry Pi nginx behind reverse-proxy Pi), CQ5 runner raspberry-pi-arm64 labels linux-arm64/ubuntu-latest, reference projects SlpSoftware and SlpModularCms (Podman runner: container actions fail with 409, use shell steps; sshpass/scp pattern). Created .gitea/workflows/continuous_integration.yaml (check, lighthouse, deploy-test, deploy-production), web/config/serverConfig.ts + writeServerConfig.ts + test (generated web/deploy/iis/web.config and web/deploy/nginx/andreaslop-test.conf from securityHeaders), .gitattributes eol=lf, packageManager pnpm@12.11.2 (lockfile now pins pnpm). Found and fixed: LHCI_COLLECT__SETTINGS__* env replaced the desktop preset (verified locally); chrome flags now via LIGHTHOUSE_CHROME_FLAGS read in lighthouserc. Docs: operations/deployment/deployment-plan.md, deployment-instructions.md, rollback-plan.md. Lint, format, 88 tests, build pass. Not verifiable from here: Chromium in runner container, lftp TLS with hoster certificate, Pi write permissions."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; artifacts generated, awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Test/Production Parity
|
||||
|
||||
**Timestamp**: 2026-10-18T19:56:29Z
|
||||
|
||||
**User Input**: "Waarom doen we op de test-omgeving vergelijkbaar met de andere projecten en niet zo dichtbij mogelijk bij de productie-omgeving?" / "Een sub-domein telt als een extra website. In het pakket wat ik wi lheb ik er maar 1 dus het subdomein zal ik op de pi blijven hosten. Uiteindelijk gaat het erom dat de website getest kan worden. Als de deployment anders is omdat de omgeving anders is is dat prima. Als er op test maar niks wordt gedaan wat op productie niet kan of het moet goed gedocumenteerd worden als het gaat om handmatig vs automatisch"
|
||||
|
||||
**AI Response**: "Acknowledged test choice was based on CQ4 and reference projects without explicit parity weighing; explained identical vs different parts and IIS/FTPS-specific risk; offered options. Owner keeps test on Pi. Added 'Test vs Production' section to deployment-plan.md (identical parts, difference table with automatic/manual per aspect, IIS risk mitigation via dress rehearsal before go-live); flagged symlink rollback as test-only capability in plan and rollback-plan.md; added dress-rehearsal step to go-live in deployment-instructions.md."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Simpler Test Deploy
|
||||
|
||||
**Timestamp**: 2026-10-18T20:18:00Z
|
||||
|
||||
**User Input**: "De opzet voor de testomgeving mag simpeler dan de andere apps. hij hoeft geen oud eversies tebewaren. het is maar een testomgeving. De productie site draait wel daar, maar dat is een wordpress website dus dat moet niet gaan conflicteren"
|
||||
|
||||
**AI Response**: "Interpreted 'daar' as the Raspberry Pi. Replaced release folders + symlink with empty-and-copy deploy to DEPLOY_PATH_TEST; added guard refusing empty path, '/', paths with spaces, or folders containing wp-config.php/wp-content (verified locally on 5 cases incl. a WordPress folder left intact). nginx test block root /var/www/andreaslop-test, never default_server (test added). Rollback on test now same pipeline route as production. Updated deployment-plan (D8, D13, difference table incl. WordPress neighbour), deployment-instructions 1.2, rollback-plan. Lint, format, tests pass."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Test Path
|
||||
|
||||
**Timestamp**: 2026-10-18T21:13:04Z
|
||||
|
||||
**User Input**: "in het plan zie ik staan /var/ww/andreaslop-test, maar het moet worden /var/ww/html/andreaslop-test"
|
||||
|
||||
**AI Response**: "Interpreted as /var/www/html/andreaslop-test. Replaced in serverConfig.ts (nginx root), regenerated deploy/nginx/andreaslop-test.conf, deployment-instructions.md (variable example, mkdir/chown). Config tests pass. Flagged: if /var/www/html is the WordPress web root, the test folder becomes reachable as a subfolder of the WordPress site; asked owner to confirm WordPress root."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - nginx Config Location
|
||||
|
||||
**Timestamp**: 2026-10-18T21:16:29Z
|
||||
|
||||
**User Input**: "Het pad naar de config is ` /etc/nginx/conf.d/andreaslop-test.conf` en niet de sites-available folder"
|
||||
|
||||
**AI Response**: "Updated deployment-instructions.md step 1.2: copy to /etc/nginx/conf.d/andreaslop-test.conf (loaded automatically, no sites-enabled symlink), with cp command and note to re-copy after pnpm server-config."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Reverse Proxy Check
|
||||
|
||||
**Timestamp**: 2026-10-18T21:18:22Z
|
||||
|
||||
**User Input**: "op de eigen server draai ik een raspbedrry pi met nginx als reverse proxy. Daar laat ik ook de ssl certificaten genereren met certbot/lets encrypt. Dan op de hostende server zorge ik dat de boel naar de juiste folder gaat. Klopt dan de huidige configuiratie nog?"
|
||||
|
||||
**AI Response**: "Reviewed chain proxy (TLS, certbot) -> hosting Pi nginx :80 -> folder. Config holds; two additions: proxy must pass Host header (else default block = WordPress answers), and absolute_redirect off on the backend so nginx redirects stay relative behind the proxy. Added absolute_redirect off + comment to serverConfig.ts generator with a test, regenerated deploy/nginx/andreaslop-test.conf; added proxy server block example, certbot command and 'do not duplicate headers on proxy' to deployment-instructions.md step 1.2.4."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Reverse Proxy Config File
|
||||
|
||||
**Timestamp**: 2026-10-18T21:20:15Z
|
||||
|
||||
**User Input**: "heb ik voor de reverse proxy, die ook nginx draait, dan ook niet een config bestand nodig? Doe het alleen voor http, certbot maakt daar wel https van met ssl"
|
||||
|
||||
**AI Response**: "Added nginxProxyConf() to the generator: web/deploy/nginx/test.andreaslop.nl.proxy.conf (HTTP only, Host header + X-Forwarded-*, placeholder HOSTING_PI_ADDRESS, no security headers). Tests: Host header present, no add_header, same server_name as test block (regex anchored after a comment false match). Instructions 1.2.4 now install this file, replace placeholder, run certbot, and warn not to re-copy after certbot. Deployment plan D11 and difference table updated. 14 config tests pass."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Test Fix
|
||||
|
||||
**Timestamp**: 2026-10-18T21:20:55Z
|
||||
|
||||
**User Input**: "(none — self-review)"
|
||||
|
||||
**AI Response**: "Found that the hostname test passed vacuously: sed dropped the backslash (^s* instead of ^\s*), so both matches were undefined. Fixed regex, asserted the proxy hostname is test.andreaslop.nl, and verified by mutation that a differing hostname makes the test fail. 14 config tests pass, format clean."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Hosting Pi Address
|
||||
|
||||
**Timestamp**: 2026-10-18T21:23:42Z
|
||||
|
||||
**User Input**: "Ik heb HOSTING_PI_ADDRESS ingevuld in het test config bestand. die kan je voor de volgende kee rook aanhouden"
|
||||
|
||||
**AI Response**: "Owner filled 192.168.1.103 in the generated proxy config; drift test caught it. Moved the address into config/serverConfig.ts (hostingPiAddress), regenerated deploy/nginx/test.andreaslop.nl.proxy.conf (same content), removed placeholder instructions and the sed step from deployment-instructions.md 1.2.4. 14 config tests pass."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; awaiting approval
|
||||
|
||||
---
|
||||
|
||||
## Deployment Setup - Commit and Push
|
||||
|
||||
**Timestamp**: 2026-10-18T22:18:51Z
|
||||
|
||||
**User Input**: "commit ook de operations changes en push dan. Dan kan ik gaan kijken of de workflow werkt. Werkt dat of moet die workflow eerst op master komen?"
|
||||
|
||||
**AI Response**: "Set up ssh-agent via ~/.ssh/agent.env (owner added key in own Git Bash). Lint, format, 93 tests, build and workflow YAML pass. Committing operations work (pipeline, .gitattributes, server config generator + generated configs, deployment docs) on feature/frontend-shell and pushing the branch to origin."
|
||||
|
||||
**Context**: OPERATIONS - Deployment Setup; commit and push for pipeline verification
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user