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.2.travis.2737.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2725.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.2.travis.2724.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2711.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2710.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2705.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.0 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2689.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2669.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2666.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2660.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2639.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2637.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2635.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2633.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2627.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2623.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2621.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2619.5 lib/dpl/provider/puppet_forge.rb