Sha256: 2458d58bb7d5c7ac5b7e257dfe8b145a5043e8b3c1f55ecf490ae3b07a03a5fe

Contents?: true

Size: 998 Bytes

Versions: 9

Compression:

Stored size: 998 Bytes

Contents

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

      requires 'json_pure', :load => 'json/pure'
      requires 'puppet', :load => 'puppet/face'
      requires 'puppet-blacksmith', :load => 'puppet_blacksmith'

      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

9 entries across 9 versions & 1 rubygems

Version Path
dpl-1.8.18.travis.1553.3 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1552.3 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1551.3 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1544.3 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1543.3 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1530.3 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1529.4 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1527.4 lib/dpl/provider/puppet_forge.rb
dpl-1.8.18.travis.1518.4 lib/dpl/provider/puppet_forge.rb