Skip to content

ci(backend): deploy the release's compose files to the server - #21

Merged
gustmrg merged 1 commit into
mainfrom
ci/deploy-compose-files
Oct 11, 2026
Merged

gustmrg merged 1 commit into
mainfrom
ci/deploy-compose-files

Conversation

@gustmrg

@gustmrg gustmrg commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • The backend deploy checks out apps/backend/docker-compose.yml and docker-compose.prod.yml from the release tag and uploads them to DEPLOY_PATH as *.new.
  • On the server, docker compose config checks them against .env. The deploy stops if the check fails or reports variable is not set (Compose only warns about unset variables and uses an empty value). In that case the .new files are removed and the current files stay in place.
  • After a successful check, the current files are kept as *.prev and replaced. The rest of the deploy (pull, migrations, up) is unchanged.
  • docs/deployment.md describes the step and the rule that follows from it.

Why only the backend deploy

Both apps share these compose files but are versioned separately. If the MCP deploy also copied files from its own tag, republishing an older MCP release would restore older compose files. So compose changes reach production with the next backend release, including changes that only affect the MCP service.

Testing

I extracted the new validation and swap block from the workflow and ran it against a sample .env:

  • With every variable set, it replaces the files and keeps the old ones as *.prev.
  • With S3_BUCKET_NAME removed, it fails, leaves the current files untouched and removes the .new files.
  • An invalid value (a bad bind IP) also fails the check.

The full workflow will first run on the next backend release.

The deploy ran docker compose with whatever compose files were already
on the server, so changes to them in the repository never reached
production and the two copies drifted. Upload the files from the
release tag, check them against the server's .env (failing on unset
variables, which compose only warns about), and swap them in, keeping
the previous files as *.prev. Only the backend deploy does this, so
republishing an older MCP release cannot restore older compose files.
@gustmrg
gustmrg merged commit 289927a into main Oct 11, 2026
4 checks passed
@gustmrg
gustmrg deleted the ci/deploy-compose-files branch October 11, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant