Exclude files - trellis deployment

Hello, how can I exclude files in trellis? When I do production deployment, it always deploy files like composer.json, composer.lock and other development files.

Thank you.

Trellis deploys using git archive which respects the .gitattributes file. You can see the default Bedrock one: https://github.com/roots/bedrock/blob/master/.gitattributes

However, you definitely need the composer files to be deployed since Trellis runs composer install as part of the deploy.

1 Like

Is there way how can I delete files after deployment? I am running yarn build:production while deployment, so I need these files.

Of course you can write a Custom task using our hooks feature to delete any files you don’t want.

Ansible’s file module will make it easier.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.