Class: Capistrano::Deploy::SCM::None

Inherits:
Base
  • Object
show all
Defined in:
lib/capistrano/recipes/deploy/scm/none.rb

Overview

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

Dereference symbolic links. Copy files instead. Handy when you
reference files and directory outside of your deployment root.
set :copy_dereference_symlink, true

Instance Attribute Summary

Attributes inherited from Base

#configuration

Instance Method Summary collapse

Methods inherited from Base

#command, default_command, #diff, #handle_data, #initialize, #local, #local?, #next_revision, #scm, #sync

Constructor Details

This class inherits a constructor from Capistrano::Deploy::SCM::Base

Instance Method Details

#checkout(revision, destination) ⇒ Object Also known as: export

Simply does a copy from the :repository directory to the :destination directory.



34
35
36
# File 'lib/capistrano/recipes/deploy/scm/none.rb', line 34

def checkout(revision, destination)
  !Capistrano::Deploy::LocalDependency.on_windows? ? "cp -R#{configuration[:copy_dereference_symlink]?'L':''} #{repository} #{destination}" : "xcopy #{repository} \"#{destination}\" /S/I/Y/Q/E"
end

#headObject

No versioning, thus, no head. Returns the empty string.



28
29
30
# File 'lib/capistrano/recipes/deploy/scm/none.rb', line 28

def head
  ""
end

#log(from = "", to = "") ⇒ Object

log: There’s no log, so it just echos from and to.



47
48
49
# File 'lib/capistrano/recipes/deploy/scm/none.rb', line 47

def log(from="", to="")
  "No SCM: #{from} - #{to}"
end

#query_revision(revision) ⇒ Object

No versioning, so this just returns the argument, with no modification.



41
42
43
# File 'lib/capistrano/recipes/deploy/scm/none.rb', line 41

def query_revision(revision)
  revision
end