17 Delivery, release control and final assessment
Write a deployment record before touching an account: provider/account ID, region, domain, administrator sources, machine/disk sizes, backup destination, retention, secret storage, monthly spending ceiling and retirement date.
Outcome: turn local evidence into a controlled live release. Files: .github/workflows/verify.yml, compose.release.yaml, pytest -q ~/playground/automation-service/test_service.py, infrastructure/. No cloud resource is created by these files.
Choose a concrete target
Write a deployment record before touching an account: provider/account ID, region, domain, administrator sources, machine/disk sizes, backup destination, retention, secret storage, monthly spending ceiling and retirement date. State the user outcome and expected demand. A single private VM is a suitable learning target when its downtime and failure domain match the exercise; it is not an automatic production architecture.
The cloud-init example supplies a starting host configuration. Review it with the actual image and access model. It contains an obvious public-key placeholder and does not configure a passwordless administrator. Establish provider console recovery and an approved administrator path. Never discover after locking SSH that your only account cannot perform the intended administration.
Use official Docker/Caddy installation instructions for the chosen OS version. Record the package versions and repository source. Bind the application to loopback18768, keep the database private, and expose only the reviewed administrative and HTTP/HTTPS paths. Verify access from a separate machine, including IPv6 when enabled. Validate proxy configuration before reload and preserve unrelated sites.
Build and release identity
The GitHub workflow runs frozen dependency installation, static checks, tests, dependency audit, Compose validation and a container build. Third-party actions are pinned to retrieved commit hashes; proof/action-pins.json records their provenance. The hosted workflow has not run until it is installed in an approved repository and produces a receipt. It does not publish images or deploy anything.
For a releasable artifact, build once from a reviewed source revision, scan it, record its digest and promote that same digest. Use a protected production environment and short-lived deployment identity with narrowly scoped permissions. The companion release helper accepts only a repository@sha256 identity and requires the image to be present on the target. The helper's default mode validates configuration and prints a plan.
The placeholder deliberately fails validation. After an actual artifact and host are reviewed, adding --apply performs the single-host Compose release. This is a mutating operation. Confirm the Docker context, backup and schema compatibility before executing it. The helper records the last ready release and the previous identity; if readiness fails, it retains the prior receipt and stops. It does not automatically reverse database migrations or claim customer-workflow success.
Rollback and roll-forward
Retain the previous compatible image and configuration. For rollback, review the actual schema state, then apply that previous digest and run the full authenticated smoke test. A backward-incompatible migration may require a forward fix or separate-database restore. Do not mechanically switch old code against a new schema and call it recovery.
The local operations drill demonstrates an unready candidate being rejected, a healthy routing switch and a route rollback while HTTPS clients observe the active release marker. A and B run the same source with different release markers. This proves the selection mechanism; it does not prove two separately built images, the remote proxy, a hosted pipeline or production load.
Live acceptance form
| Check | Evidence to record | Pass condition |
|---|---|---|
| DNS and TLS | Hostname, resolver, certificate check time | Expected address and trusted hostname match |
| User workflow | Synthetic request ID, final result, duration | Accepted job completes within target |
| Access boundaries | Missing/invalid token and other-tenant result | Denial without data leakage |
| Exposure | Approved external port checks | Only intended services reachable |
| Durability | Restart and restore receipt | Expected committed records recovered |
| Monitoring | Fault start, firing delivery, recovery delivery | Correct recipient receives both |
| Release recovery | Candidate and previous artifact digests | Failed candidate contained; compatible recovery succeeds |
| Operations | Owner, schedule, escalation and cost ceiling | Named responsibility and reviewed spend |
Keep secrets and customer payloads out of evidence. Store screenshots or logs only when they add proof. Mark unexecuted checks pending rather than guessing their outcome from configuration.
Independent final examination
A beginner passes by running and explaining the CLI/API/worker lifecycle. An intermediate operator must diagnose three injected faults: wrong database URL, stopped worker and duplicate webhook. An advanced candidate must design and execute a compatible migration, rotation, encrypted recovery and a failed release recovery. A specialist must add one selected server role and demonstrate its specific failure modes.
Score each exercise on correctness, explanation, security, recoverability and evidence. Require a reviewer to reproduce one critical path from the documentation. A critical access-control or data-loss failure blocks a pass regardless of total score. After remediation, repeat the failing scenario with fresh inputs; do not change the rubric to excuse the failure.
For expert-level judgment, add constraints: limited downtime, a fixed budget, uncertain upstream completion, regional outage or an expiring credential. Explain the chosen tradeoff, its alternatives and the remaining risk. Genuine expertise is demonstrated repeatedly across real systems and incidents, with peers reviewing the evidence.
Keep the guide current
Treat this as a versioned course. Maintain a tested-version matrix and dated receipts. Review dependencies and upstream documentation on a regular schedule; retest after security-sensitive or protocol changes. New examples must include prerequisites, exact environment, input/output contract, failure cases, cleanup and evidence status. Keep the pinned release tag, editable source, documentation, and verification manifest so readers can identify the material they used.
The release helper refuses remote Docker contexts and target environment overrides, prints the selected Unix-socket endpoint, and uses an explicit maintenance sequence: stop API/worker with a40-second grace period, start the database, run role setup/migration/seeding, then start the application. A failed migration leaves writers stopped for diagnosis. This is planned downtime, not a rolling zero-downtime deployment.
Lock in what you just learned (3 quick questions)
:latest tag?