Sha256: 5b62abd32899d030a501b630944c0cc28e00bef76f6169d54fa35b76072682c5

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

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)
          !Capistrano::Deploy::LocalDependency.on_windows? ? "cp -R #{repository} #{destination}" : "xcopy #{repository} \"#{destination}\" /S/I/Y/Q/E"
        end

        alias_method :export, :checkout

        # No versioning, so this just returns the argument, with no
        # modification.
        def query_revision(revision)
          revision
        end
        
        # log: There's no log, so it just echos from and to.
        
        def log(from="", to="")
          "No SCM: #{from} - #{to}"
        end
        
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-2.14.2 lib/capistrano/recipes/deploy/scm/none.rb
capistrano-2.14.1 lib/capistrano/recipes/deploy/scm/none.rb
capistrano-2.13.5 lib/capistrano/recipes/deploy/scm/none.rb