Last Updated: February 25, 2016
·
706
· boris

Different repositories on Capistrano

If you're like me, and don't have your code on Github and instead of that you're using your own-in-house Git server, you probably will need this.

The problem

Local repository from network on http://git.example.com. "Remote" repository on http://git.example.com:8081 (Yeah, I know... Don't ask why :))

The solution

I use stages. Staging and production, so I've production.rb and staging.rb on my deploy folder with the following content:

# staging.rb
role :web, "X.X.X.X", "Y.Y.Y.Y"
set :repository, "http://git.example.com/#{application}"
# production.rb
role :web, "A.A.A.A", "B.B.B.B"
set :repository, "http://git.example.com:8081/#{application}"

With this example, you can setup different repository address for different stages.

Enjoy, up-vote and share.