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.1.travis.2617.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2615.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2611.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2608.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2603.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2592.5 lib/dpl/provider/puppet_forge.rb
dpl-puppet_forge-1.9.1.travis.2589.5 lib/dpl/provider/puppet_forge.rb