Repository navigation
ci(backend): deploy the release's compose files to the server - #21
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/backend/docker-compose.ymlanddocker-compose.prod.ymlfrom the release tag and uploads them toDEPLOY_PATHas*.new.docker compose configchecks them against.env. The deploy stops if the check fails or reportsvariable is not set(Compose only warns about unset variables and uses an empty value). In that case the.newfiles are removed and the current files stay in place.*.prevand replaced. The rest of the deploy (pull, migrations,up) is unchanged.docs/deployment.mddescribes 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:*.prev.S3_BUCKET_NAMEremoved, it fails, leaves the current files untouched and removes the.newfiles.The full workflow will first run on the next backend release.