Sha256: b85bf2d04d6612fc555d35c51a57dcc76903d7032f7c2d8df276fcad1ed36f29

Contents?: true

Size: 906 Bytes

Versions: 127

Compression:

Stored size: 906 Bytes

Contents

require 'json/pure'
require 'puppet/face'
require 'puppet_blacksmith'

module DPL
  class Provider
    class PuppetForge < Provider
      require 'pathname'

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

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

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

      def needs_key?
        false
      end

      def check_app
        modulefile.metadata
      end

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

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

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
dpl-puppet_forge-1.10.13 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.13.travis.4159.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.13.travis.4141.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.13.travis.4040.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.13.travis.4033.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.12 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.12.travis.4032.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.12.travis.3794.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.12.travis.3506.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.11.travis.3504.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.11 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.11.travis.3499.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.11.travis.3497.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.10 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.9 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.9.travis.3280.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.9.travis.3258.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.8 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.8.travis.3236.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.10.8.travis.3216.5 lib/dpl/provider/puppet_forge.rb