Skip to content

fix: only chmod files owned by deploy user in shared storage - #36

Merged
loadinglucian merged 1 commit into
mainfrom
fix/deploy-chmod-owned-files-only
Feb 25, 2026
Merged

fix: only chmod files owned by deploy user in shared storage#36
loadinglucian merged 1 commit into
mainfrom
fix/deploy-chmod-owned-files-only

Conversation

@loadinglucian

Copy link
Copy Markdown
Owner

Summary

  • Filters find in set_group_writable_tree with -user flag so chmod is only attempted on files owned by the deploy user, avoiding Operation not permitted errors from www-data-owned view cache files
  • Suppresses any residual errors with 2>/dev/null || true for robustness
  • Removes artisan docs:clear and the docs-output/.locks mkdir from the deploy script — cache clearing is handled by optimize:clear and the locks directory is created on demand

Test plan

  • Run dep site:deploy — deployment should complete without chmod errors
  • Verify shared storage remains group-writable after deployment

When artisan optimize runs view:cache, it skips views already compiled
by PHP-FPM (www-data) and left in shared storage. The subsequent
set_group_writable_tree call then fails with "Operation not permitted"
because chmod cannot be run on files owned by another user.

Filter both find commands with -user to target only deployer-owned
entries and suppress errors with 2>/dev/null so mixed-ownership
storage directories don't abort the deployment.

Also removes the docs:clear artisan call and docs-output/.locks mkdir
from the deploy script — the optimize:clear step already handles cache
clearing and the locks directory is created on demand.
@loadinglucian
loadinglucian merged commit 0d57204 into main Feb 25, 2026
6 checks passed
@loadinglucian
loadinglucian deleted the fix/deploy-chmod-owned-files-only branch February 25, 2026 16:29
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