Class: Capistrano::Deploy::Strategy::Remote

Class | Capistrano::Deploy::Strategy::Remote
In: | lib/capistrano/recipes/deploy/strategy/remote.rb lib/capistrano/recipes/deploy/strategy/remote.rb
Parent: | Base

An abstract superclass, which forms the base for all deployment strategies which work by grabbing the code from the repository directly from remote host. This includes deploying by checkout (the default), and deploying by export.

### Methods

check! check! command command deploy! deploy! mark mark scm_run scm_run

### Public Instance methods

check!()

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 18
    18:         def check!
    19:           super.check do |d|
    20:             d.remote.command(source.command)
    21:           end
    22:         end

check!()

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 18
    18:         def check!
    19:           super.check do |d|
    20:             d.remote.command(source.command)
    21:           end
    22:         end

deploy!()

Executes the SCM command for this strategy and writes the REVISION mark file to each host.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 14
    14:         def deploy!
    15:           scm_run "#{command} && #{mark}"
    16:         end

deploy!()

Executes the SCM command for this strategy and writes the REVISION mark file to each host.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 14
    14:         def deploy!
    15:           scm_run "#{command} && #{mark}"
    16:         end

### Protected Instance methods

command()

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.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 39
    39:           def command
    40:             raise NotImplementedError, "`command' is not implemented by #{self.class.name}"
    41:           end

command()

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.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 39
    39:           def command
    40:             raise NotImplementedError, "`command' is not implemented by #{self.class.name}"
    41:           end

mark()

Returns the command which will write the identifier of the revision being deployed to the REVISION file on each host.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 45
    45:           def mark
    46:             "(echo #{revision} > #{configuration[:release_path]}/REVISION)"
    47:           end

mark()

Returns the command which will write the identifier of the revision being deployed to the REVISION file on each host.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 45
    45:           def mark
    46:             "(echo #{revision} > #{configuration[:release_path]}/REVISION)"
    47:           end

scm_run(command)

Runs the given command, filtering output back through the handle_data filter of the SCM implementation.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 28
    28:           def scm_run(command)
    29:             run(command) do |ch,stream,text|
    30:               ch[:state] ||= { :channel => ch }
    31:               output = source.handle_data(ch[:state], stream, text)
    32:               ch.send_data(output) if output
    33:             end
    34:           end

scm_run(command)

Runs the given command, filtering output back through the handle_data filter of the SCM implementation.

[Source]

        # File lib/capistrano/recipes/deploy/strategy/remote.rb, line 28
    28:           def scm_run(command)
    29:             run(command) do |ch,stream,text|
    30:               ch[:state] ||= { :channel => ch }
    31:               output = source.handle_data(ch[:state], stream, text)
    32:               ch.send_data(output) if output
    33:             end
    34:           end

[Validate]