I want to deploy a Magento application with Capistrano 3. Let's say I would use this gitignore file. Since these files are not in the repository, they won't be copied to the remote server. But the first time I deploy the application it should copy these files. What is the best way to achieve this? Should I upload the files to the remote server manually the first time? Should I use another .gitignore and include the files in the repository? Or is there a better way?
Disclaimer: I am not familiar with Magento at all.
For everyting that has to be run once before the first deployment on each server use deploy:setup
(see docs).
The problem in your case is, that capistrano will per default create a new directory each time you deploy and link it as current
. Thus even when you copy the files for the first deploy, the second deploy will use another folder.
I see two approaches:
shared
folder that capistrano creates and upload your files there only once (during setup) and on later deploys copy or link the files/folders accordinglyGenerally you should reconsider your project structure. Maybe it would be a good thing to don't put all those files on gitignore, since they seem to be an integral part of your project. Generally I only put things on gitignore that are:
So in your case it seems you got some libraries and stuff like that on .gitignore and I guess without those your project would not work. Thus I would either add them to the repo or consider adding them as submodules, if they are larger and subject to changes by a third party.