From dfe19aa70c903147e94b777f8f3cd77c247db5b6 Mon Sep 17 00:00:00 2001 From: Phillip Goldenburg Date: Thu, 24 Apr 2008 22:34:21 -0500 Subject: [PATCH] Add export deployment option for git and add instructions to deploy from a local repository. --- lib/capistrano/recipes/deploy/scm/git.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/capistrano/recipes/deploy/scm/git.rb b/lib/capistrano/recipes/deploy/scm/git.rb index df8a90ab..8f49f691 100644 --- a/lib/capistrano/recipes/deploy/scm/git.rb +++ b/lib/capistrano/recipes/deploy/scm/git.rb @@ -92,13 +92,24 @@ module Capistrano # # set :git_shallow_clone, 1 # + # For those that don't like to leave your entire repository on + # your production server you can: + # + # set :deploy_via, :export + # + # To deploy from a local repository: + # + # set :repository, "file://." + # set :deploy_via, :copy + # # AUTHORS # ------- # # Garry Dolley http://scie.nti.st # Contributions by Geoffrey Grosenbach http://topfunky.com # Scott Chacon http://jointheconversation.org - # and Alex Arnell http://twologic.com + # Alex Arnell http://twologic.com + # and Phillip Goldenburg class Git < Base # Sets the default command name for this SCM on your *local* machine. @@ -145,6 +156,12 @@ module Capistrano execute.join(" && ") end + + # An expensive export. Performs a checkout as above, then + # removes the repo. + def export(revision, destination) + checkout(revision, destination) << " && rm -Rf #{destination}/.git" + end # Merges the changes to 'head' since the last fetch, for remote_cache # deployment strategy