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:
- Copy the files in question on every deploy
- Use the
shared
folder that capistrano creates and upload your files there only once (during setup) and on later deploys copy or link the files/folders accordingly
Generally 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:
- Reproducable (e.g. compiled assets)
- Temporary (cache, etc.)
- Sensitive (config files containing passwords)
- Local (e.g. configs or the like, that are specific on every machine)
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.