Sha256: 2e7db0b2f6808c5e5c916eb46d7a7c0b4bba9c9eb4579039069bdc0821da064b

Contents?: true

Size: 1.28 KB

Versions: 1

Compression:

Stored size: 1.28 KB

Contents

require 'alpha_omega/deploy/strategy/base'

module Capistrano
  module Deploy
    module Strategy

      # An abstract superclass, which forms the base for all deployment
      # strategies which work by grabbing the code from the repository directly
      # from remote host.
      class Remote < Base
        # Executes the SCM command for this strategy and writes the REVISION
        # mark file to each host.
        def deploy!
          commands.each do |command|
            run command
          end
          run mark
        end

        def check!
          super.check do |d|
            d.remote.command(source.command)
          end
        end

        protected

          # An abstract method which must be overridden in subclasses, to
          # return the actual SCM command(s) which must be executed on each
          # target host in order to perform the deployment.
          def commands
            raise NotImplementedError, "`command' is not implemented by #{self.class.name}"
          end

          # Returns the command which will write the identifier of the
          # revision being deployed to the REVISION file on each host.
          def mark
            "echo #{revision} > #{configuration[:current_release_path]}/REVISION"
          end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alpha_omega-0.0.138 lib/alpha_omega/deploy/strategy/remote.rb