Class: KnifeSpork::SporkUpload

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

Constant Summary collapse

CHECKSUM =
'checksum'
MATCH_CHECKSUM =
/[0-9a-f]{32,}/

Instance Method Summary collapse

Methods included from Runner

included

Instance Method Details

#runObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/chef/knife/spork-upload.rb', line 33

def run
  self.config = Chef::Config.merge!(config)
  config[:cookbook_path] ||= Chef::Config[:cookbook_path]

  if @name_args.empty?
    show_usage
    ui.error("You must specify the --all flag or at least one cookbook name")
    exit 1
  end

  #First load so plugins etc know what to work with
  @cookbooks = load_cookbooks(name_args)
  include_dependencies if config[:depends]

  run_plugins(:before_upload)

  #Reload cookbook in case a VCS plugin found updates
  @cookbooks = load_cookbooks(name_args)
  include_dependencies if config[:depends]

  upload
  run_plugins(:after_upload)
end