zmii
zmii

Reputation: 4277

Using capistrano to deploy same project from different machines

We have a team of 2 people writing Rails application. We use DigitalOcean as of VPS and capistrano to deploy it.

But the capistrano deployment scripts are only on one of our two machines.

Is it possible to set up capistrano on the second machine to deploy same project also from it? If yes, how this looks like?

P.S. This might be very easy like adding some SSH keys and running cap production deploy from second machine as the remote VPS has whole infrastructure set up. But we can't take the risk on production system.

Upvotes: 0

Views: 104

Answers (1)

will_in_wi
will_in_wi

Reputation: 2653

There are a couple ways of doing this:

  • Commit your Cap scripts to the repository alongside your code (this is how I tend to do it; it works well with Ruby on Rails, the config structure matches). Anyone who wants to deploy just needs their SSH key set up on the server.
  • Create another repository with the deploy scripts; similarly to above, you need SSH keys.
  • Use a CI server to deploy.
  • Come up with something else more esoteric. Capistrano is pretty flexible.

Where I work, we generally just add Capistrano to a Rails app's Gemfile, and anyone who checks it out can deploy it to any server to which they have access. Developer SSH keys are added to the servers for this purpose.

Good luck!

Upvotes: 2

Related Questions