Excluding files from being deployed with Capistrano while still under version control with Git
3 Solutions collect form web for “Excluding files from being deployed with Capistrano while still under version control with Git”
As of August 30th, 2013, you can simply create a
.gitattributes file and
export-ignore the files/folders of your choice.
features/ export-ignore spec/ export-ignore
There are many ways to accomplish this, you can keep your tests in a test branch of the app like VonC suggested, but that would mean that you would make all your changes in your main branch and then sync it to your test branch. (Not without its merits, but sometimes a pain)
You can use the .gitignore file to your directory.
Any file that you add to this will not be added to your repository. Since capistrano just pulls and posts from your repository, not having the files included will keep them off your production server.
Last but not least, if you want the test files in your main repository for version control, you can add a recipe to your config/deploy.rb file.. something like:
And specify the files you want to remove, this will remove any files you want when you deploy. 🙂
Any of the above will work. Pick the method that works for you.
You could have those tests in a test branch (on which you merge your main branch before any test)
That way, when you ask Capistrano to deploy what is on your main branch, no test of any sort is ever included.