Class: Sprinkle::Actors::Vlad

Inherits:
Actor show all
Defined in:
lib/sprinkle/actors/vlad.rb

Overview

The Vlad actor is one of the delivery method options available out of the box with Sprinkle. If you have the vlad the deployer gem installed, you may use this delivery. The only configuration option available, and which is mandatory to include is script. An example:

deployment do
  delivery :vlad do
    script 'deploy'
  end
end

script is given a list of files which vlad will include and load. These recipes are mainly to set variables such as :user, :password, and to set the app domain which will be sprinkled.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Vlad

:nodoc:



22
23
24
# File 'lib/sprinkle/actors/vlad.rb', line 22

def initialize(&block) #:nodoc:
  self.instance_eval &block if block
end

Instance Attribute Details

#loaded_recipesObject

:nodoc:



20
21
22
# File 'lib/sprinkle/actors/vlad.rb', line 20

def loaded_recipes
  @loaded_recipes
end

Instance Method Details

#install(installer, roles, opts = {}) ⇒ Object

:nodoc:



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/sprinkle/actors/vlad.rb', line 56

def install(installer, roles, opts={}) #:nodoc:
  @installer=installer
  if installer.install_sequence.include?(:TRANSFER)
    process_with_transfer(installer.package.name, installer.install_sequence, roles, opts)
  else
    process(installer.package.name, installer.install_sequence, roles, opts)
  end
# recast our rake error to the common sprinkle error type
rescue ::Rake::CommandFailedError => e
  raise Sprinkle::Errors::RemoteCommandFailure.new(installer, {}, e)
ensure 
  @installer = nil
end

#script(name) ⇒ Object

Defines a script file which will be included by vlad. Use these script files to set vlad specific configurations. Multiple scripts may be specified through multiple script calls, an example:

deployment do
  delivery :vlad do
    script 'deploy'
    script 'magic_beans'
  end
end


50
51
52
53
54
# File 'lib/sprinkle/actors/vlad.rb', line 50

def script(name)
  @loaded_recipes ||= []
  require name
  @loaded_recipes << name
end

#servers_for_role?Boolean

:nodoc:



26
27
28
29
# File 'lib/sprinkle/actors/vlad.rb', line 26

def servers_for_role? #:nodoc:
  raise "The vlad actor needs a maintainer.  "+
  "Please file an issue on github.com/sprinkle-tool/sprinkle if you can help."
end

#sudo?Boolean

:nodoc:



31
32
33
34
# File 'lib/sprinkle/actors/vlad.rb', line 31

def sudo? #:nodoc:
  # TODO
  raise
end

#sudo_commandObject

:nodoc:



36
37
38
# File 'lib/sprinkle/actors/vlad.rb', line 36

def sudo_command #:nodoc:
  "sudo"
end

#verify(verifier, roles, opts = {}) ⇒ Object

:nodoc:



70
71
72
73
# File 'lib/sprinkle/actors/vlad.rb', line 70

def verify(verifier, roles, opts={}) #:nodoc:
  process(verifier.package.name, commands, roles, 
    :suppress_and_return_failures => true)
end