Class: Fhcap::CLI::Cookbook

Inherits:
ThorBase show all
Includes:
ReposHelper
Defined in:
lib/fhcap/cookbook.rb

Instance Attribute Summary

Attributes inherited from ThorBase

#config, #thor

Instance Method Summary collapse

Methods included from ReposHelper

#find_cluster, #find_cluster_pwds, #find_cluster_pwds_with_repo, #find_cluster_with_repo, #find_data_bag, #find_data_bag_item, #find_environment, #find_repo_item, #find_role, #get_cookbook_deps, #get_cookbook_meta, #get_cookbook_versions, #get_cookbooks, #get_dirty_cookbooks, #get_entry_dependencies, #get_modified_cookbooks, #git_diff, #is_dirty?, #modified?, #repo_cfg, #repo_clusters_dir, #repo_cookbook_paths, #repo_dir, #repo_names, #repo_paths, #repos_config, #repos_dir, #run_inside_repo_dir

Methods inherited from ThorBase

add_shared_option, chef_server_names, cluster_template_names, config_key_collection, exit_on_failure?, #initialize, provider_names, provider_names_for, repo_names, run_cmd, run_knife_cmd, shared_options

Methods included from ProvidersHelper

#provider_availability_zones, #provider_config, #provider_credentials, #provider_for, #provider_names, #provider_names_for, #provider_regions, #provider_type, #providers_config

Methods included from Thor::Actions

#run

Constructor Details

This class inherits a constructor from Fhcap::ThorBase

Instance Method Details

#archiveObject



101
102
103
104
# File 'lib/fhcap/cookbook.rb', line 101

def archive
  require "fhcap/tasks/chef/cookbook/archive"
  Tasks::Chef::Cookbook::Archive.new(task_options(options.dup)).run
end

#check_bumpsObject



68
69
70
71
# File 'lib/fhcap/cookbook.rb', line 68

def check_bumps
  require "fhcap/tasks/chef/cookbook/check_bumps"
  Tasks::Chef::Cookbook::CheckBumps.new(task_options(options.dup.merge({modified: true, base_branch: options['base-branch']}))).run
end

#listObject



91
92
93
94
# File 'lib/fhcap/cookbook.rb', line 91

def list
  require "fhcap/tasks/chef/cookbook/list"
  Tasks::Chef::Cookbook::List.new(task_options(options.dup)).run
end

#updateObject



43
44
45
46
47
48
49
50
51
# File 'lib/fhcap/cookbook.rb', line 43

def update
  require "fhcap/tasks/chef/cookbook/update_version"
  cookbooks = get_cookbooks(options, nil, repo_cookbook_paths('-cookbooks'))
  say("Cookbook update for #{cookbooks}", :yellow)

  cookbooks.each do |cookbook|
    Tasks::Chef::Cookbook::UpdateVersion.new(task_options(options.dup.merge({cookbook: cookbook}))).run
  end
end

#update_attributeObject



113
114
115
116
117
118
119
120
121
# File 'lib/fhcap/cookbook.rb', line 113

def update_attribute
  require "fhcap/tasks/chef/cookbook/update_attribute"
  cookbooks = get_cookbooks(options, nil, repo_cookbook_paths('-cookbooks'))
  say("Cookbook update_attribute for #{cookbooks}", :yellow)

  cookbooks.each do |cookbook|
    Tasks::Chef::Cookbook::UpdateAttribute.new(task_options(options.dup.merge({cookbook: cookbook}))).run
  end
end

#update_metadataObject



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/fhcap/cookbook.rb', line 77

def 
  require "fhcap/tasks/chef/cookbook/update_metadata"
  require "fhcap/tasks/chef/cookbook/update_readme"
  cookbooks = get_cookbooks(options, nil, repo_cookbook_paths('-cookbooks'))
  say("Cookbook update_metadata for #{cookbooks}", :yellow)

  cookbooks.each do |cookbook|
    Tasks::Chef::Cookbook::.new(task_options(options.dup.merge({cookbook: cookbook}))).run
    Tasks::Chef::Cookbook::UpdateReadme.new(task_options(options.dup.merge({cookbook: cookbook}))).run
  end
end