Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I Deploy With Capistrano Without SCM?

Capistrano configfile has the config

set :scm,:git and the :repo_url and :branch

Can I deploy with capistrano without scm?

set :scm, :none            
set :repository,  "."       

What is the benefit of scm config in the Capistrano deploy?

like image 818
wcc526 Avatar asked Jun 14 '14 14:06

wcc526


2 Answers

With Capistrano 2 you could do that. With Capistrano 3 you can't.

One trick you can do is host a Git repository on the same server the app is hosted, since to 'host' a repository means simply having the repo files in a directory somewhere. You can push updates there from your local machine via SSH, and for Capistrano the repo URL would be just the path to the repo on the server.

You don't need a third-party service to host repos, and you don't need any special server software either.

As to the benefits of having code under source control - there are too many, which is why everyone is using it, which is why Capistrano developers don't even bother with supporting non-SCM deploy.

like image 133
Leonid Shevtsov Avatar answered Sep 30 '22 03:09

Leonid Shevtsov


You can use the CapistranoRailsArtifact gem to do that.

This gem allows

you to package your Rails app into a .tar.gz and deploy it easily. This works by creating a new type of 'scm' for Capistrano 3.

like image 40
David Resnick Avatar answered Sep 30 '22 04:09

David Resnick