Class: DeployRubygem::RakeCookbookTask
- Inherits:
-
RakeDefaultTask
- Object
- RakeDefaultTask
- DeployRubygem::RakeCookbookTask
- Includes:
- ChefCookbookTask, InspecCookbookTask, KnifeCookbookTask
- Defined in:
- lib/deploy_rubygem/rake/cookbook.rb
Overview
RakeTask to use with DeployRubygem projects
Instance Method Summary collapse
-
#clean_cookbook ⇒ Object
:nodoc:.
-
#cycle ⇒ Object
:nodoc:.
-
#default ⇒ Object
:nodoc:.
-
#define_tasks ⇒ Object
:nodoc:.
-
#develop ⇒ Object
:nodoc:.
-
#initialize(task_name = 'cookbook', desc = 'Run DeployRubygem task') ⇒ RakeCookbookTask
constructor
A new instance of RakeCookbookTask.
-
#release_cookbook ⇒ Object
:nodoc:.
-
#test_cookbook ⇒ Object
:nodoc:.
-
#test_framework ⇒ Object
:nodoc:.
Methods included from KnifeCookbookTask
Methods included from InspecCookbookTask
Methods included from ChefCookbookTask
#chef_client, #install_cookbook, #install_policy, #release_policy, #report
Methods inherited from RakeDefaultTask
#check_local, #chef_install, #compliance, #push, #rspec_and_rubocop, #test_version
Constructor Details
#initialize(task_name = 'cookbook', desc = 'Run DeployRubygem task') ⇒ RakeCookbookTask
Returns a new instance of RakeCookbookTask.
18 19 20 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 18 def initialize(task_name = 'cookbook', desc = 'Run DeployRubygem task') super end |
Instance Method Details
#clean_cookbook ⇒ Object
:nodoc:
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 66 def clean_cookbook # :nodoc: desc "@desc with #{__method__}" task clean_cookbook: %i[clean] do system('kitchen destroy base') FileUtils.rm_f('Policyfile.lock.json') FileUtils.rm_f('Gemfile.lock') FileUtils.rm_f('.rspec_status') profiles_folder = File.join(%w[compliance profiles]) Dir.children(profiles_folder).each do |sub_folder| vendor_folder = File.join(profiles_folder, sub_folder, 'vendor') inspec_file = File.join(profiles_folder, sub_folder, 'inspec.lock') FileUtils.rm_rf(vendor_folder) FileUtils.rm_f(inspec_file) end end end |
#cycle ⇒ Object
:nodoc:
46 47 48 49 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 46 def cycle # :nodoc: desc "@desc with #{__method__}" task cycle: %i[test_framework release_policy test_version] end |
#default ⇒ Object
:nodoc:
41 42 43 44 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 41 def default # :nodoc: desc "@desc with #{__method__}" task default: %i[test_framework build install:local] end |
#define_tasks ⇒ Object
:nodoc:
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 22 def define_tasks # :nodoc: super test_cookbook release_cookbook cookstyle build_cookbook install_policy release_policy install_cookbook report clean_cookbook chef_client end |
#develop ⇒ Object
:nodoc:
51 52 53 54 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 51 def develop # :nodoc: desc "@desc with #{__method__}" task develop: %i[build_cookbook spec push install release_policy report] end |
#release_cookbook ⇒ Object
:nodoc:
61 62 63 64 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 61 def release_cookbook # :nodoc: desc "@desc with #{__method__}" task release_cookbook: %i[clean_cookbook release_policy release] end |
#test_cookbook ⇒ Object
:nodoc:
56 57 58 59 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 56 def test_cookbook # :nodoc: desc "@desc with #{__method__}" task test_cookbook: %i[build_cookbook spec push install release_policy report] end |
#test_framework ⇒ Object
:nodoc:
36 37 38 39 |
# File 'lib/deploy_rubygem/rake/cookbook.rb', line 36 def test_framework # :nodoc: desc "@desc with #{__method__}" task test_framework: %i[build_cookbook spec clean_cookbook] end |