Class: DPL::Provider::PuppetForge

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/puppet_forge.rb

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #cleanup, #commit_msg, context, #create_key, #deploy, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#buildObject



17
18
19
20
# File 'lib/dpl/provider/puppet_forge.rb', line 17

def build
  pmod = Puppet::Face['module', :current]
  pmod.build('./')
end

#check_appObject



26
27
28
# File 'lib/dpl/provider/puppet_forge.rb', line 26

def check_app
  modulefile.
end

#check_authObject

Raises:



30
31
32
33
# File 'lib/dpl/provider/puppet_forge.rb', line 30

def check_auth
  raise Error, "must supply a user" unless option(:user)
  raise Error, "must supply a password" unless option(:password)
end

#forgeObject



13
14
15
# File 'lib/dpl/provider/puppet_forge.rb', line 13

def forge
  @forge ||= Blacksmith::Forge.new(options[:user], options[:password], options[:url])
end

#modulefileObject



9
10
11
# File 'lib/dpl/provider/puppet_forge.rb', line 9

def modulefile
  @modulefile ||= Blacksmith::Modulefile.new
end

#needs_key?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/dpl/provider/puppet_forge.rb', line 22

def needs_key?
  false
end

#push_appObject



35
36
37
38
39
# File 'lib/dpl/provider/puppet_forge.rb', line 35

def push_app
  build
  log "Uploading to Puppet Forge #{forge.username}/#{modulefile.name}"
  forge.push!(modulefile.name)
end