dpl-puppet_forge 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a8b76a886453a753a1088cee3294f9bb5ae8d083
4
+ data.tar.gz: be1a1e6427bf19875b8951b001de3998e3eeabb9
5
+ SHA512:
6
+ metadata.gz: da1f42788bea7f324ce6733e705aad83b33431f5ef60d7432e817c89ee60df4567f24f1ce7043b3a005fb28adda45142b2750e62b8747e3ecdfaebf37264cad4
7
+ data.tar.gz: 48f542b81ee569a613f8c411da5e7aed0eed59216d190a62b82e8c473228d554e4b30b759179c7d8758ba8ecbc88dd1467aac731e477a2723bd1a620d752c33e
@@ -0,0 +1,3 @@
1
+ require './gemspec_helper'
2
+
3
+ gemspec_for 'puppet_forge', [['puppet'], ['puppet-blacksmith']]
@@ -0,0 +1,43 @@
1
+ require 'json/pure'
2
+ require 'puppet/face'
3
+ require 'puppet_blacksmith'
4
+
5
+ module DPL
6
+ class Provider
7
+ class PuppetForge < Provider
8
+ require 'pathname'
9
+
10
+ def modulefile
11
+ @modulefile ||= Blacksmith::Modulefile.new
12
+ end
13
+
14
+ def forge
15
+ @forge ||= Blacksmith::Forge.new(options[:user], options[:password], options[:url])
16
+ end
17
+
18
+ def build
19
+ pmod = Puppet::Face['module', :current]
20
+ pmod.build('./')
21
+ end
22
+
23
+ def needs_key?
24
+ false
25
+ end
26
+
27
+ def check_app
28
+ modulefile.metadata
29
+ end
30
+
31
+ def check_auth
32
+ raise Error, "must supply a user" unless option(:user)
33
+ raise Error, "must supply a password" unless option(:password)
34
+ end
35
+
36
+ def push_app
37
+ build
38
+ log "Uploading to Puppet Forge #{forge.username}/#{modulefile.name}"
39
+ forge.push!(modulefile.name)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,60 @@
1
+ require 'spec_helper'
2
+ require 'dpl/provider/puppet_forge'
3
+ require 'puppet/face'
4
+ require 'puppet_blacksmith'
5
+
6
+ describe DPL::Provider::PuppetForge do
7
+ subject :provider do
8
+ described_class.new(DummyContext.new, :user => 'puppetlabs', :password => 's3cr3t')
9
+ end
10
+
11
+ describe "forge" do
12
+ it 'should include the user and password specified' do
13
+ expect(provider.forge.username).to eq(provider.options[:user])
14
+ expect(provider.forge.password).to eq(provider.options[:password])
15
+ end
16
+ end
17
+
18
+ describe "build" do
19
+ it 'should use Puppet module tool to build the module' do
20
+ pmt = double('pmt')
21
+ expect(::Puppet::Face).to receive(:[]).and_return(pmt)
22
+ expect(pmt).to receive(:build).with('./')
23
+ provider.build
24
+ end
25
+ end
26
+
27
+ describe "#check_auth" do
28
+ it 'should require a user' do
29
+ provider.options.update(:user => nil)
30
+ expect{ provider.check_auth }.to raise_error("must supply a user")
31
+ end
32
+
33
+ it 'should require a password' do
34
+ provider.options.update(:password => nil)
35
+ expect{ provider.check_auth }.to raise_error("must supply a password")
36
+ end
37
+ end
38
+
39
+ describe "#check_app" do
40
+ it 'should load module metadata using Blacksmith' do
41
+ modulefile = double('modulefile')
42
+ expect(::Blacksmith::Modulefile).to receive(:new).and_return(modulefile)
43
+ expect(modulefile).to receive(:metadata) { true }
44
+ provider.check_app
45
+ end
46
+ end
47
+
48
+ describe "#push_app" do
49
+ it 'should use Blacksmith to push to the Forge' do
50
+ forge = double('forge')
51
+ expect(provider).to receive(:build).and_return(true)
52
+ expect(provider).to receive(:modulefile).at_least(:once).and_return(double('modulefile', :name => 'test'))
53
+ expect(provider).to receive(:log).and_return(true)
54
+ expect(::Blacksmith::Forge).to receive(:new).and_return(forge)
55
+ expect(forge).to receive(:push!) { true }
56
+ expect(forge).to receive(:username) { provider.options[:user] }
57
+ provider.push_app
58
+ end
59
+ end
60
+ end
metadata ADDED
@@ -0,0 +1,187 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dpl-puppet_forge
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.9.0
5
+ platform: ruby
6
+ authors:
7
+ - Konstantin Haase
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dpl
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.9.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: puppet
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: puppet-blacksmith
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-its
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: json_pure
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: tins
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: highline
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ description: deploy tool abstraction for clients
154
+ email: konstantin.mailinglists@googlemail.com
155
+ executables: []
156
+ extensions: []
157
+ extra_rdoc_files: []
158
+ files:
159
+ - dpl-puppet_forge.gemspec
160
+ - lib/dpl/provider/puppet_forge.rb
161
+ - spec/provider/puppet_forge_spec.rb
162
+ homepage: https://github.com/travis-ci/dpl
163
+ licenses:
164
+ - MIT
165
+ metadata: {}
166
+ post_install_message:
167
+ rdoc_options: []
168
+ require_paths:
169
+ - lib
170
+ required_ruby_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '2.2'
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ requirements: []
181
+ rubyforge_project:
182
+ rubygems_version: 2.6.13
183
+ signing_key:
184
+ specification_version: 4
185
+ summary: deploy tool
186
+ test_files:
187
+ - spec/provider/puppet_forge_spec.rb