Sha256: a024cda9d9f2256410464cd2ad65aaea13955b60b5887247770fefae7fd6b53c

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

module Dpl
  module Providers
    class Puppetforge < Provider
      status :alpha

      full_name 'Puppet Forge'

      description sq(<<-str)
        tbd
      str

      gem 'puppet', '~> 5.5.14', require: 'puppet/face'
      gem 'puppet-blacksmith', '~> 3.3.1', require: 'puppet_blacksmith'

      env :puppetforge

      opt '--username NAME', 'Puppet Forge user name', required: true, alias: :user
      opt '--password PASS', 'Puppet Forge password', required: true, secret: true
      opt '--url URL', 'Puppet Forge URL to deploy to', default: 'https://forgeapi.puppetlabs.com/'

      msgs upload: 'Uploading to Puppet Forge %s/%s'

      def validate
        file.metadata
      end

      def deploy
        build
        info :upload, forge.username, file.name
        forge.push!(file.name)
      end

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

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

      def forge
        @forge ||= Blacksmith::Forge.new(username, password, url)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dpl-2.0.0.alpha.14 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.13 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.12 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.11 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.10 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.9 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.8 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.7 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.6 lib/dpl/providers/puppetforge.rb
dpl-2.0.0.alpha.5 lib/dpl/providers/puppetforge.rb