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.9.6.travis.2790.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.6.travis.2786.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.6.travis.2785.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.5.travis.2783.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.5.travis.2781.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.5.travis.2782.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.5.travis.2775.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.4.travis.2773.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.4 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.4.travis.2768.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.4.travis.2766.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.3 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2764.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2763.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2762.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2750.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2749.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2748.5 lib/dpl/provider/puppet_forge.rb