Module: DeployRubygem::ChefCookbookTask

Included in:
RakeCookbookTask
Defined in:
lib/deploy_rubygem/rake/cookbook/chef.rb

Overview

RakeTask to use with DeployRubygem projects

Instance Method Summary collapse

Instance Method Details

#chef_clientObject

:nodoc:



7
8
9
10
11
12
# File 'lib/deploy_rubygem/rake/cookbook/chef.rb', line 7

def chef_client # :nodoc:
  desc "@desc with #{__method__}"
  task :chef_client do
    system('sudo chef-client')
  end
end

#install_cookbookObject

:nodoc:



28
29
30
31
32
33
# File 'lib/deploy_rubygem/rake/cookbook/chef.rb', line 28

def install_cookbook # :nodoc:
  desc "@desc with #{__method__}"
  task :install_cookbook do
    system("sudo chef-client -o #{@task_name}")
  end
end

#install_policyObject

:nodoc:



14
15
16
17
18
19
# File 'lib/deploy_rubygem/rake/cookbook/chef.rb', line 14

def install_policy # :nodoc:
  desc "@desc with #{__method__}"
  task install_policy: %i[build_cookbook] do
    system('chef install Policyfile.rb')
  end
end

#release_policyObject

:nodoc:



21
22
23
24
25
26
# File 'lib/deploy_rubygem/rake/cookbook/chef.rb', line 21

def release_policy # :nodoc:
  desc "@desc with #{__method__}"
  task release_policy: %i[clean_cookbook install_policy] do
    system('chef push prod Policyfile.lock.json')
  end
end

#reportObject

:nodoc:



35
36
37
38
39
40
# File 'lib/deploy_rubygem/rake/cookbook/chef.rb', line 35

def report # :nodoc:
  desc "@desc with #{__method__}"
  task :report do
    system("sudo chef-client -o #{@task_name}::compile_report")
  end
end