mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Added :none SCM module for deploying a specific directory's contents
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@8995 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
8e639fe393
commit
d9812c4d8a
2 changed files with 46 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* Added :none SCM module for deploying a specific directory's contents [Jamis Buck]
|
||||||
|
|
||||||
* Improved "copy" strategy supports local caching and pattern exclusion (via :copy_cache and :copy_exclude variables) [Jamis Buck]
|
* Improved "copy" strategy supports local caching and pattern exclusion (via :copy_cache and :copy_exclude variables) [Jamis Buck]
|
||||||
|
|
||||||
|
|
||||||
|
|
44
lib/capistrano/recipes/deploy/scm/none.rb
Normal file
44
lib/capistrano/recipes/deploy/scm/none.rb
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
require 'capistrano/recipes/deploy/scm/base'
|
||||||
|
|
||||||
|
module Capistrano
|
||||||
|
module Deploy
|
||||||
|
module SCM
|
||||||
|
|
||||||
|
# A trivial SCM wrapper for representing the current working directory
|
||||||
|
# as a repository. Obviously, not all operations are available for this
|
||||||
|
# SCM, but it works sufficiently for use with the "copy" deployment
|
||||||
|
# strategy.
|
||||||
|
#
|
||||||
|
# Use of this module is _not_ recommended; in general, it is good
|
||||||
|
# practice to use some kind of source code management even for anything
|
||||||
|
# you are wanting to deploy. However, this module is provided in
|
||||||
|
# acknowledgement of the cases where trivial deployment of your current
|
||||||
|
# working directory is desired.
|
||||||
|
#
|
||||||
|
# set :repository, "."
|
||||||
|
# set :scm, :none
|
||||||
|
# set :deploy_via, :copy
|
||||||
|
class None < Base
|
||||||
|
# No versioning, thus, no head. Returns the empty string.
|
||||||
|
def head
|
||||||
|
""
|
||||||
|
end
|
||||||
|
|
||||||
|
# Simply does a copy from the :repository directory to the
|
||||||
|
# :destination directory.
|
||||||
|
def checkout(revision, destination)
|
||||||
|
"cp -R #{repository} #{destination}"
|
||||||
|
end
|
||||||
|
|
||||||
|
alias_method :export, :checkout
|
||||||
|
|
||||||
|
# No versioning, so this just returns the argument, with no
|
||||||
|
# modification.
|
||||||
|
def query_revision(revision)
|
||||||
|
revision
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue