1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Add export deployment option for git and add instructions to deploy from a local repository.

This commit is contained in:
Phillip Goldenburg 2008-04-24 22:34:21 -05:00
parent d11006102c
commit dfe19aa70c

View file

@ -92,13 +92,24 @@ module Capistrano
# #
# set :git_shallow_clone, 1 # 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 # AUTHORS
# ------- # -------
# #
# Garry Dolley http://scie.nti.st # Garry Dolley http://scie.nti.st
# Contributions by Geoffrey Grosenbach http://topfunky.com # Contributions by Geoffrey Grosenbach http://topfunky.com
# Scott Chacon http://jointheconversation.org # Scott Chacon http://jointheconversation.org
# and Alex Arnell http://twologic.com # Alex Arnell http://twologic.com
# and Phillip Goldenburg
class Git < Base class Git < Base
# Sets the default command name for this SCM on your *local* machine. # Sets the default command name for this SCM on your *local* machine.
@ -146,6 +157,12 @@ module Capistrano
execute.join(" && ") execute.join(" && ")
end 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 # Merges the changes to 'head' since the last fetch, for remote_cache
# deployment strategy # deployment strategy
def sync(revision, destination) def sync(revision, destination)