Class: KnifeSpork::SporkBump

Inherits:
Chef::Knife
  • Object
show all
Includes:
Runner
Defined in:
lib/chef/knife/spork-bump.rb

Constant Summary collapse

TYPE_INDEX =
{ :major => 0, :minor => 1, :patch => 2, :manual => 3 }.freeze

Instance Method Summary collapse

Methods included from Runner

included

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/chef/knife/spork-bump.rb', line 12

def run
  self.config = Chef::Config.merge!(config)
  
  if @name_args.empty?
    show_usage
    ui.error("You must specify at least a cookbook name")
    exit 1
  end

  #First load so plugins etc know what to work with
  @cookbook = load_cookbook(name_args.first)

  run_plugins(:before_bump)

  #Reload cookbook in case a VCS plugin found updates
  @cookbook = load_cookbook(name_args.first)
  bump
  run_plugins(:after_bump)
end