Class: Shuttle::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/shuttle/task.rb

Instance Method Summary collapse

Constructor Details

#initialize(deploy, task_name, allow_failures = false) ⇒ Task

Returns a new instance of Task.



3
4
5
6
7
# File 'lib/shuttle/task.rb', line 3

def initialize(deploy, task_name, allow_failures = false)
  @deploy         = deploy
  @task_name      = task_name
  @allow_failures = allow_failures
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/shuttle/task.rb', line 9

def run
  commands = find_task_commands(@task_name)
  
  if commands.nil?
    @deploy.error("Unable to find task: #{@task_name}")
  end

  commands.each do |cmd|
    execute(@task_name, cmd, @allow_failures)
  end
end