Search code examples
rubycapistranocapifony

Is that possible to place all deploy related files outside of the project base directory


My directory structure is as looks like the following :

+deploy
 |
 | Capfile
 +- config/
    |
    +- deploy/
       |
       | production.rb
         ...
         ....
    deploy.rb


+frontend-app
 |
 +- My app structure.

I want to make this structure working with capistrano, For now my Capfile and related capistrano configs are placed under the /frontend-app directory.

Any help would be appreciated.

Updated : I checked these and these but I think it doesn't provides exact abstraction.


Solution

  • There is no need to change your project structure.

    Capistrano actually does not look at your local project structure when performing a deploy. Instead, it uses the :repo_url value to clone your project's repository onto the server, and works with your project there.

    In other words, Capistrano doesn't care where you run it; you could even put your Capistrano files in an entirely different repo. All that matters is that your :repo_url points to the repository you wish to deploy.

    So don't sweat where the Capistrano files actually live. In your case, you can just do this:

    cd deploy; cap production deploy
    

    And it should work fine. :)