docs: detail Phase 1 Forgejo CI/CD implementation #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/forgejo-cicd-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PLAN.mdinto an implementation-ready CI/CD execution planKey contracts
sudodevmaps only to staging; protectedmainmaps only to production and the shared edgevalidation-completefor the exact SHA and go through a root-owned, operator-installed wrapperValidation
git diff --checkPLAN.mdsections 15-18, 22-24, and ADR 0009origin/devDocumentation only: this merge request does not add workflows, application scaffolds, containers, host configuration, or deployment privileges.
@ -0,0 +126,4 @@| Project | Services | Networks | Persistent state | Updated by ||---|---|---|---|---|| `personal-blog-edge` | Caddy | external staging and production edge networks | Caddy data/config and bounded access logs | production workflow only; manual bootstrap before first deployment |Hmm so I think instead the Caddy should be inside the staging / prod docker compose projects. I will have additional infrastructure do the TLS termination and dns registration, but the Caddy for each project acts as a reverse proxy in front of all the services.
@ -0,0 +175,4 @@Do not copy GitHub-specific event, token, or expression assumptions without asmall compatibility workflow proving them on this Forgejo instance.### 5.3 DNS and pre-cutover TLSNo special cms.* domain, can we do this? I'd prefer the strapi to be under blog.yongbeom.com/admin. Help me also check strapi supports this feature that it can occupy a domain subpath instead of a separate domain. Also let's make the sub domain _blog instead, and later on as the last step we can do a cutover by modifying the dns record.
@ -0,0 +201,4 @@Host files:```text/etc/personal-blog/staging.env.env wont be on the host. All stored as runner secrets that we echo to dotenv on the runner at the start of the Workflow and then clean up afterwards. Volumes in ~/.volumes/blog/{staging,production}, backed up into backblaze, cloudflare buckets with restic. We can add backup as the last step. Only setup needed on the host should be the infra and the runner, no other global files.
@ -0,0 +425,4 @@2. validate the argument count, literal environment, and lowercase full SHA;3. map the environment to a hard-coded protected branch, project, env file,release/state/upload roots, networks, aliases, and smoke target;4. acquire `/var/lock/personal-blog-docker.lock` with a bounded wait;No need lock, forgejo takes care of it
@ -0,0 +435,4 @@8. verify path ownership/modes plus disk and memory headroom;9. render Compose, run topology assertions, and build environment+SHA-taggedimages before replacing a running service;10. run the exact application command:Let's have a just file in the base directory for all the commands, and the runner runs just xyz
@ -0,0 +440,4 @@/etc/personal-blog/<environment>.env -f infra/compose.yaml up -d --build--remove-orphans`;11. for production only, validate and reconcile the edge project from the samerelease after the application is ready enough to accept edge traffic;Make validation as simple as possible
@ -0,0 +490,4 @@- waits a bounded time for `validation-complete` success on that exact SHA andfails closed on missing, pending, cancelled, failed, ambiguous, or stalestatus;- invokes only `sudo ... staging "$DEPLOY_SHA"`.Why need sudo? Just docker compose up/down
Pull request closed