Class: Heroploy::DeployTaskLib

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/heroploy/tasks/deploy_task_lib.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deploy_config) ⇒ DeployTaskLib

Returns a new instance of DeployTaskLib.



16
17
18
19
# File 'lib/heroploy/tasks/deploy_task_lib.rb', line 16

def initialize(deploy_config)
  @deploy_config = deploy_config
  define
end

Instance Attribute Details

#deploy_configObject

Returns the value of attribute deploy_config.



14
15
16
# File 'lib/heroploy/tasks/deploy_task_lib.rb', line 14

def deploy_config
  @deploy_config
end

Instance Method Details

#defineObject



21
22
23
24
# File 'lib/heroploy/tasks/deploy_task_lib.rb', line 21

def define
  define_fetch_task
  define_env_tasks
end

#define_env_tasksObject



33
34
35
36
37
# File 'lib/heroploy/tasks/deploy_task_lib.rb', line 33

def define_env_tasks
  deploy_config.environments.each do |env_config|
    EnvTaskLib.new(deploy_config, env_config)
  end
end

#define_fetch_taskObject



26
27
28
29
30
31
# File 'lib/heroploy/tasks/deploy_task_lib.rb', line 26

def define_fetch_task
  desc 'do a git fetch'
  task :fetch do
    git_fetch
  end
end