Class: Chef::Knife::ArtifactoryShare

Inherits:
Knife::SupermarketShare
  • Object
show all
Defined in:
lib/chef/knife/knife_art_share.rb

Instance Method Summary collapse

Instance Method Details

#orig_do_uploadObject



27
# File 'lib/chef/knife/knife_art_share.rb', line 27

alias_method :orig_do_upload, :do_upload

#orig_get_categoryObject



26
# File 'lib/chef/knife/knife_art_share.rb', line 26

alias_method :orig_get_category, :get_category

#orig_runObject



25
# File 'lib/chef/knife/knife_art_share.rb', line 25

alias_method :orig_run, :run

#runObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chef/knife/knife_art_share.rb', line 29

def run
  begin
  # I'm forced to use threadlocal until we find a better solution... can't really find a way to pass configuration
  # down to the Chef::CookbookUploader, Chef::ServerAPI, Chef::HTTP or Chef::HTTP::Authenticator
  # (which are created one after another starting) with CookbookUploader to make it skip the signing key verification.
  # Can make the authenticator skip by passing load_signing_key(nil, nil) and opts[:sign_request] => false
  Thread.current[:artifactory_deploy] = 'yes'
  # Send artifactory deploy flag to super
  config[:artifactory_deploy] = true
  Chef::Log.debug("[KNIFE-ART] running site share with config: #{config}")
  orig_run
  ensure
    # always cleanup threadlocal
    Thread.current[:artifactory_deploy] = nil
  end
end