Write deployment packages to the system temp dir instead of .bref/ - #50
Merged
Conversation
Every deploy of a bref.php application wrote its package to .bref/package-<hash>.zip in the project and never removed older ones, growing by ~43 MB per deploy. Worse, a project that also has a serverless.yml would package .bref/ into its Lambda zip and fail on the 250 MB unzipped size limit with an error that points nowhere near the cause. Packages are now written to the system temp directory and deleted once uploaded. Deploys also remove the packages that previous CLI versions left behind in .bref/ (and the directory itself once empty). Fixes CLOUD-56 Claude-Session: https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX
mnapoli
added a commit
to brefphp/bref
that referenced
this pull request
Aug 27, 2026
The CLI no longer writes deployment packages to .bref/ in the project (brefphp/cli#50), so there is nothing there to exclude anymore. Claude-Session: https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX
bref.php deployments are completely internal, nobody is using them yet, so there are no user projects with accumulated packages to clean up. Claude-Session: https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX
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.
Fixes CLOUD-56.
Every deploy of a
bref.phpapplication wrote its package to.bref/package-<hash>.zipin the project directory and never removed older ones: the smoke test application had accumulated 12 zips totalling ~520 MB. And a project that also has aserverless.ymlwould package.bref/into its Lambda zip and fail on the 250 MB unzipped size limit, with an error pointing nowhere near the cause.Packages are now written to the system temp directory (
tempnam()) instead of.bref/, and deleted once the upload finishes (in afinally, so failed uploads don't leave them behind either). No cleanup of packages left behind by older CLI versions: bref.php deployments are completely internal, so no user projects have accumulated any.Verified with the Bref Cloud e2e smoke test pointed at this checkout (
BREF_CLI=... tests/e2e/smoke-test.sh): the deployment succeeded end to end and no packages were written to the project or left in the temp directory.The now-pointless
!.bref/**default exclusion inBref\Cloud\Laravelwas removed on thecloudbranch of brefphp/bref (fd36ad6b).https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX