kpm 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/install_example.yml +0 -5
- data/kpm.gemspec +1 -1
- data/lib/kpm/base_artifact.rb +0 -4
- data/lib/kpm/base_installer.rb +3 -45
- data/lib/kpm/blob.rb +4 -0
- data/lib/kpm/inspector.rb +8 -1
- data/lib/kpm/installer.rb +1 -15
- data/lib/kpm/killbill_plugin_artifact.rb +3 -12
- data/lib/kpm/nexus_helper/nexus_api_calls_v2.rb +1 -1
- data/lib/kpm/plugins_directory.rb +3 -4
- data/lib/kpm/plugins_directory.yml +3 -3
- data/lib/kpm/tasks.rb +2 -70
- data/lib/kpm/version.rb +1 -1
- data/pom.xml +1 -1
- data/spec/kpm/remote/installer_spec.rb +4 -25
- data/spec/kpm/remote/killbill_plugin_artifact_spec.rb +0 -48
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8511e401669df3cf28d9ff916b158764238109c34e818a8221ee598c11d78750
|
4
|
+
data.tar.gz: cc284e39cf1c3d5b2cf7ece8fc7cbc38d2853016c666378ff1127a6761d5a04d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f6e3965bfb2e4c32707d845add23ff06fe7eb7d3bd4550d94863f2ffa207049c578ba90dff1cac3d1609427a3a6ae010582e7fa8cec309a151e7fd1e595f18e
|
7
|
+
data.tar.gz: 031a2b0f7da148e24b7a13ff90e6c023d3d381040d7de8161389ca9ac523487b64540ab6174c2d1aab2d110bcf19d6af4291b28eade76c4f2d6317303ae7c662
|
data/install_example.yml
CHANGED
data/kpm.gemspec
CHANGED
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
|
|
43
43
|
|
44
44
|
s.add_dependency 'highline', '~> 1.6.21'
|
45
45
|
s.add_dependency 'killbill-client', '~> 3.2'
|
46
|
-
s.add_dependency 'rubyzip', '~>1.
|
46
|
+
s.add_dependency 'rubyzip', '~> 1.3.0'
|
47
47
|
s.add_dependency 'thor', '~> 0.19.1'
|
48
48
|
|
49
49
|
s.add_development_dependency 'gem-release', '~> 2.2'
|
data/lib/kpm/base_artifact.rb
CHANGED
@@ -25,10 +25,6 @@ module KPM
|
|
25
25
|
KILLBILL_JAVA_PLUGIN_PACKAGING = 'jar'
|
26
26
|
KILLBILL_JAVA_PLUGIN_CLASSIFIER = nil
|
27
27
|
|
28
|
-
KILLBILL_RUBY_PLUGIN_GROUP_ID = 'org.kill-bill.billing.plugin.ruby'
|
29
|
-
KILLBILL_RUBY_PLUGIN_PACKAGING = 'tar.gz'
|
30
|
-
KILLBILL_RUBY_PLUGIN_CLASSIFIER = nil
|
31
|
-
|
32
28
|
KAUI_GROUP_ID = 'org.kill-bill.billing.kaui'
|
33
29
|
KAUI_ARTIFACT_ID = 'kaui-standalone'
|
34
30
|
KAUI_PACKAGING = 'war'
|
data/lib/kpm/base_installer.rb
CHANGED
@@ -79,7 +79,7 @@ module KPM
|
|
79
79
|
:group_id => group_id, :artifact_id => artifact_id, :packaging => packaging, :classifier => classifier))
|
80
80
|
end
|
81
81
|
|
82
|
-
def install_plugin(plugin_key, raw_kb_version = nil, specified_group_id = nil, specified_artifact_id = nil, specified_packaging = nil, specified_classifier = nil, specified_version = nil, bundles_dir = nil, specified_type = nil, force_download = false, verify_sha1 = true
|
82
|
+
def install_plugin(plugin_key, raw_kb_version = nil, specified_group_id = nil, specified_artifact_id = nil, specified_packaging = nil, specified_classifier = nil, specified_version = nil, bundles_dir = nil, specified_type = nil, force_download = false, verify_sha1 = true)
|
83
83
|
# plugin_key needs to exist
|
84
84
|
raise ArgumentError, 'Aborting installation: User needs to specify a pluginKey' if plugin_key.nil?
|
85
85
|
|
@@ -94,7 +94,6 @@ module KPM
|
|
94
94
|
# If there is no entry in plugins_directory.yml and the group_id is not the killbill default group_id, the key provided must be a user key and must have a namespace
|
95
95
|
if looked_up_artifact_id.nil? &&
|
96
96
|
specified_group_id != KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_GROUP_ID &&
|
97
|
-
specified_group_id != KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_GROUP_ID &&
|
98
97
|
plugin_key.split(':').size == 1
|
99
98
|
raise ArgumentError, "Aborting installation: pluginKey = #{plugin_key} does not exist in plugin_directory.yml so format of the key must have a user namespace (e.g namespace:key)"
|
100
99
|
end
|
@@ -114,14 +113,7 @@ module KPM
|
|
114
113
|
version = specified_version || looked_up_version || LATEST_VERSION
|
115
114
|
destination = plugins_dir.join('java').join(artifact_id).join(version)
|
116
115
|
else
|
117
|
-
|
118
|
-
warn_if_jruby_jar_missing(bundles_dir) if verify_jruby_jar
|
119
|
-
|
120
|
-
group_id = specified_group_id || looked_up_group_id || KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_GROUP_ID
|
121
|
-
packaging = specified_packaging || looked_up_packaging || KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_PACKAGING
|
122
|
-
classifier = specified_classifier || looked_up_classifier || KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_CLASSIFIER
|
123
|
-
version = specified_version || looked_up_version || LATEST_VERSION
|
124
|
-
destination = plugins_dir.join('ruby')
|
116
|
+
raise ArgumentError, "Aborting installation: plugin type #{type} unsupported"
|
125
117
|
end
|
126
118
|
sha1_file = "#{bundles_dir}/#{SHA1_FILENAME}"
|
127
119
|
plugins_manager = PluginsManager.new(plugins_dir, @logger)
|
@@ -178,7 +170,7 @@ module KPM
|
|
178
170
|
plugin_name = name.nil? ? Utils.get_plugin_name_from_file_path(file_path) : name
|
179
171
|
destination = plugins_dir.join('java').join(plugin_name).join(version)
|
180
172
|
else
|
181
|
-
|
173
|
+
raise ArgumentError, "Aborting installation: plugin type #{type} unsupported"
|
182
174
|
end
|
183
175
|
|
184
176
|
artifact_info = KPM::KillbillPluginArtifact.pull_from_fs(@logger, file_path, destination)
|
@@ -245,10 +237,6 @@ module KPM
|
|
245
237
|
info.merge('status' => (info[:skipped] ? 'UP_TO_DATE' : 'INSTALLED'),
|
246
238
|
:group_id => group_id, :artifact_id => artifact_id, :packaging => packaging, :classifier => classifier))
|
247
239
|
|
248
|
-
# The special JRuby bundle needs to be called jruby.jar
|
249
|
-
# TODO .first - code smell
|
250
|
-
File.rename Dir.glob("#{destination}/killbill-platform-osgi-bundles-jruby-*.jar").first, destination.join('jruby.jar') unless info[:skipped]
|
251
|
-
|
252
240
|
info
|
253
241
|
end
|
254
242
|
|
@@ -281,35 +269,5 @@ module KPM
|
|
281
269
|
plugins_manager = PluginsManager.new(plugins_dir, @logger)
|
282
270
|
plugins_manager.set_active(artifact_info[:bundle_dir])
|
283
271
|
end
|
284
|
-
|
285
|
-
def warn_if_jruby_jar_missing(bundles_dir)
|
286
|
-
platform_dir = bundles_dir.join('platform')
|
287
|
-
jruby_jar = platform_dir.join('jruby.jar')
|
288
|
-
if !File.exist?(jruby_jar)
|
289
|
-
@logger.warn(" Missing installation for jruby.jar under #{platform_dir}. This is required for ruby plugin installation")
|
290
|
-
else
|
291
|
-
version = extract_jruby_jar_version(jruby_jar)
|
292
|
-
if version
|
293
|
-
@logger.info(" Detected jruby.jar version #{version}")
|
294
|
-
else
|
295
|
-
@logger.warn(" Failed to detect jruby.jar version for #{jruby_jar}")
|
296
|
-
end
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
|
-
def extract_jruby_jar_version(jruby_jar)
|
301
|
-
selected_entries = Zip::File.open(jruby_jar) do |zip_file|
|
302
|
-
zip_file.select do |entry|
|
303
|
-
entry.name == 'META-INF/maven/org.kill-bill.billing/killbill-platform-osgi-bundles-jruby/pom.properties'
|
304
|
-
end
|
305
|
-
end
|
306
|
-
|
307
|
-
if selected_entries && selected_entries.size == 1
|
308
|
-
zip_entry = selected_entries[0]
|
309
|
-
content = zip_entry.get_input_stream.read
|
310
|
-
return content.split("\n").select { |e| e.start_with?('version') }[0].split('=')[1]
|
311
|
-
end
|
312
|
-
nil
|
313
|
-
end
|
314
272
|
end
|
315
273
|
end
|
data/lib/kpm/blob.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'fileutils'
|
4
|
+
|
3
5
|
module KPM
|
4
6
|
class Blob
|
5
7
|
def initialize(value, tmp_dir)
|
6
8
|
@tmp_dir = tmp_dir
|
7
9
|
@blob_file = @tmp_dir + File::SEPARATOR + rand.to_s
|
10
|
+
# Make sure directory is 'rx' for others to allow LOAD_FILE to work
|
11
|
+
FileUtils.chmod('a+rx', @tmp_dir)
|
8
12
|
store_value(value)
|
9
13
|
end
|
10
14
|
|
data/lib/kpm/inspector.rb
CHANGED
@@ -75,7 +75,14 @@ module KPM
|
|
75
75
|
plugin_map = { plugin_name: plugin_name, plugin_path: plugin_path.to_s, type: type }
|
76
76
|
entries = get_entries(plugin_path)
|
77
77
|
set_default = entries.select { |e| e == 'SET_DEFAULT' }[0]
|
78
|
-
default_version =
|
78
|
+
default_version = nil
|
79
|
+
if set_default
|
80
|
+
begin
|
81
|
+
default_version = File.basename(File.readlink(plugin_path.join(set_default)))
|
82
|
+
rescue StandardError
|
83
|
+
# On Windows, SET_DEFAULT is a directory, not a symbolic link
|
84
|
+
end
|
85
|
+
end
|
79
86
|
|
80
87
|
non_default = entries.reject do |e|
|
81
88
|
e == 'SET_DEFAULT'
|
data/lib/kpm/installer.rb
CHANGED
@@ -127,7 +127,6 @@ module KPM
|
|
127
127
|
|
128
128
|
def install_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
|
129
129
|
install_java_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
|
130
|
-
install_ruby_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
|
131
130
|
end
|
132
131
|
|
133
132
|
def install_java_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
|
@@ -135,20 +134,7 @@ module KPM
|
|
135
134
|
|
136
135
|
infos = []
|
137
136
|
@config['plugins']['java'].each do |plugin|
|
138
|
-
infos << install_plugin(plugin['name'], raw_kb_version, plugin['group_id'], plugin['artifact_id'], plugin['packaging'], plugin['classifier'], plugin['version'], bundles_dir, 'java', force_download, verify_sha1
|
139
|
-
end
|
140
|
-
|
141
|
-
infos
|
142
|
-
end
|
143
|
-
|
144
|
-
def install_ruby_plugins(bundles_dir, raw_kb_version, force_download, verify_sha1)
|
145
|
-
return if @config['plugins'].nil? || @config['plugins']['ruby'].nil?
|
146
|
-
|
147
|
-
verify_jruby_jar = true
|
148
|
-
infos = []
|
149
|
-
@config['plugins']['ruby'].each do |plugin|
|
150
|
-
infos << install_plugin(plugin['name'], raw_kb_version, plugin['group_id'], plugin['artifact_id'], plugin['packaging'], plugin['classifier'], plugin['version'], bundles_dir, 'ruby', force_download, verify_sha1, verify_jruby_jar)
|
151
|
-
verify_jruby_jar = false
|
137
|
+
infos << install_plugin(plugin['name'], raw_kb_version, plugin['group_id'], plugin['artifact_id'], plugin['packaging'], plugin['classifier'], plugin['version'], bundles_dir, 'java', force_download, verify_sha1)
|
152
138
|
end
|
153
139
|
|
154
140
|
infos
|
@@ -8,15 +8,15 @@ module KPM
|
|
8
8
|
class << self
|
9
9
|
def pull(logger, group_id, artifact_id, packaging = 'jar', classifier = nil, version = 'LATEST', plugin_name = nil, destination_path = nil, sha1_file = nil, force_download = false, verify_sha1 = true, overrides = {}, ssl_verify = true)
|
10
10
|
coordinate_map = { group_id: group_id, artifact_id: artifact_id, packaging: packaging, classifier: classifier, version: version }
|
11
|
-
pull_and_put_in_place(logger, coordinate_map, plugin_name, destination_path,
|
11
|
+
pull_and_put_in_place(logger, coordinate_map, plugin_name, destination_path, false, sha1_file, force_download, verify_sha1, overrides, ssl_verify)
|
12
12
|
end
|
13
13
|
|
14
14
|
def versions(overrides = {}, ssl_verify = true)
|
15
|
-
plugins = { java: {}
|
15
|
+
plugins = { java: {} }
|
16
16
|
|
17
17
|
nexus = nexus_remote(overrides, ssl_verify)
|
18
18
|
|
19
|
-
[[:java, KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_GROUP_ID]
|
19
|
+
[[:java, KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_GROUP_ID]].each do |type_and_group_id|
|
20
20
|
response = REXML::Document.new nexus.search_for_artifacts(type_and_group_id[1])
|
21
21
|
response.elements.each('searchNGResponse/data/artifact') do |element|
|
22
22
|
artifact_id = element.elements['artifactId'].text
|
@@ -27,15 +27,6 @@ module KPM
|
|
27
27
|
|
28
28
|
plugins
|
29
29
|
end
|
30
|
-
|
31
|
-
protected
|
32
|
-
|
33
|
-
# Magic methods...
|
34
|
-
|
35
|
-
def ruby_plugin_and_should_skip_top_dir?(group_id, artifact_id)
|
36
|
-
# The second check is for custom ruby plugins
|
37
|
-
group_id == KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_GROUP_ID || artifact_id.include?('plugin')
|
38
|
-
end
|
39
30
|
end
|
40
31
|
end
|
41
32
|
end
|
@@ -92,7 +92,7 @@ module KPM
|
|
92
92
|
|
93
93
|
def build_query_params(coordinates, what_parameters = nil)
|
94
94
|
artifact = parse_coordinates(coordinates)
|
95
|
-
@version = artifact[:version].to_s
|
95
|
+
@version = artifact[:version].to_s
|
96
96
|
|
97
97
|
query = { g: artifact[:group_id], a: artifact[:artifact_id], e: artifact[:extension], v: version, r: configuration[:repository] }
|
98
98
|
query.merge!(c: artifact[:classifier]) unless artifact[:classifier].nil?
|
@@ -31,12 +31,11 @@ module KPM
|
|
31
31
|
return nil if plugin.nil?
|
32
32
|
|
33
33
|
type = plugin[:type]
|
34
|
-
is_ruby = type == :ruby
|
35
34
|
|
36
|
-
group_id = plugin[:group_id] ||
|
35
|
+
group_id = plugin[:group_id] || KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_GROUP_ID
|
37
36
|
artifact_id = plugin[:artifact_id] || "#{plugin_key}-plugin"
|
38
|
-
packaging = plugin[:packaging] ||
|
39
|
-
classifier = plugin[:classifier] ||
|
37
|
+
packaging = plugin[:packaging] || KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_PACKAGING
|
38
|
+
classifier = plugin[:classifier] || KPM::BaseArtifact::KILLBILL_JAVA_PLUGIN_CLASSIFIER
|
40
39
|
|
41
40
|
if raw_kb_version == 'LATEST'
|
42
41
|
version = 'LATEST'
|
@@ -19,7 +19,7 @@
|
|
19
19
|
:versions:
|
20
20
|
:0.18: 0.4.1
|
21
21
|
:0.20: 0.6.1
|
22
|
-
:0.22: 0.8.
|
22
|
+
:0.22: 0.8.4
|
23
23
|
:cybersource:
|
24
24
|
:type: :ruby
|
25
25
|
:versions:
|
@@ -38,7 +38,7 @@
|
|
38
38
|
:versions:
|
39
39
|
:0.18: 0.3.1
|
40
40
|
:0.20: 0.5.1
|
41
|
-
:0.22: 0.7.
|
41
|
+
:0.22: 0.7.2
|
42
42
|
:forte:
|
43
43
|
:type: :java
|
44
44
|
:versions:
|
@@ -80,4 +80,4 @@
|
|
80
80
|
:stripe:
|
81
81
|
:type: :java
|
82
82
|
:versions:
|
83
|
-
:0.22: 7.3.
|
83
|
+
:0.22: 7.3.1
|
data/lib/kpm/tasks.rb
CHANGED
@@ -187,8 +187,7 @@ module KPM
|
|
187
187
|
options[:destination],
|
188
188
|
'java',
|
189
189
|
options[:force_download],
|
190
|
-
options[:verify_sha1]
|
191
|
-
false)
|
190
|
+
options[:verify_sha1])
|
192
191
|
else
|
193
192
|
installer.install_plugin_from_fs(plugin_key, options[:from_source_file], nil, options[:version], options[:destination], 'java')
|
194
193
|
end
|
@@ -196,72 +195,6 @@ module KPM
|
|
196
195
|
say "Artifact has been retrieved and can be found at path: #{response[:file_path]}", :green
|
197
196
|
end
|
198
197
|
|
199
|
-
method_option :group_id,
|
200
|
-
type: :string,
|
201
|
-
default: KillbillPluginArtifact::KILLBILL_RUBY_PLUGIN_GROUP_ID,
|
202
|
-
desc: 'The plugin artifact group-id'
|
203
|
-
method_option :artifact_id,
|
204
|
-
type: :string,
|
205
|
-
default: nil,
|
206
|
-
desc: 'The plugin artifact id'
|
207
|
-
method_option :version,
|
208
|
-
type: :string,
|
209
|
-
default: nil,
|
210
|
-
desc: 'The plugin artifact version'
|
211
|
-
method_option :packaging,
|
212
|
-
type: :string,
|
213
|
-
default: KillbillPluginArtifact::KILLBILL_RUBY_PLUGIN_PACKAGING,
|
214
|
-
desc: 'The plugin artifact packaging'
|
215
|
-
method_option :classifier,
|
216
|
-
type: :string,
|
217
|
-
default: KillbillPluginArtifact::KILLBILL_RUBY_PLUGIN_CLASSIFIER,
|
218
|
-
desc: 'The plugin artifact classifier'
|
219
|
-
method_option :from_source_file,
|
220
|
-
type: :string,
|
221
|
-
default: nil,
|
222
|
-
desc: 'Specify the ruby plugin archive that should be used for the installation.'
|
223
|
-
method_option :destination,
|
224
|
-
type: :string,
|
225
|
-
default: nil,
|
226
|
-
desc: 'A different folder other than the current working directory.'
|
227
|
-
method_option :force_download,
|
228
|
-
type: :boolean,
|
229
|
-
default: false,
|
230
|
-
desc: 'Force download of the artifact even if it exists'
|
231
|
-
method_option :sha1_file,
|
232
|
-
type: :string,
|
233
|
-
default: nil,
|
234
|
-
desc: 'Location of the sha1 file'
|
235
|
-
method_option :verify_sha1,
|
236
|
-
type: :boolean,
|
237
|
-
default: true,
|
238
|
-
desc: 'Validates sha1 sum'
|
239
|
-
desc 'install_ruby_plugin plugin-key <kb-version>', 'Pulls a ruby plugin and installs it under the specified destination. If the kb-version has been specified, it is used to download the matching plugin artifact version; if not, it uses the specified plugin version or if null, the LATEST one.'
|
240
|
-
def install_ruby_plugin(plugin_key, kb_version = 'LATEST')
|
241
|
-
installer = BaseInstaller.new(logger,
|
242
|
-
options[:overrides],
|
243
|
-
options[:ssl_verify])
|
244
|
-
|
245
|
-
response = if options[:from_source_file].nil?
|
246
|
-
installer.install_plugin(plugin_key,
|
247
|
-
kb_version,
|
248
|
-
options[:group_id],
|
249
|
-
options[:artifact_id],
|
250
|
-
options[:packaging],
|
251
|
-
options[:classifier],
|
252
|
-
options[:version],
|
253
|
-
options[:destination],
|
254
|
-
'ruby',
|
255
|
-
options[:force_download],
|
256
|
-
options[:verify_sha1],
|
257
|
-
true)
|
258
|
-
else
|
259
|
-
installer.install_plugin_from_fs(plugin_key, options[:from_source_file], nil, nil, options[:destination], 'ruby')
|
260
|
-
end
|
261
|
-
|
262
|
-
say "Artifact has been retrieved and can be found at path: #{response[:file_path]}", :green
|
263
|
-
end
|
264
|
-
|
265
198
|
method_option :destination,
|
266
199
|
type: :string,
|
267
200
|
default: nil,
|
@@ -647,8 +580,7 @@ module KPM
|
|
647
580
|
logger.error e.backtrace.join("\n") unless e.is_a?(Interrupt)
|
648
581
|
end
|
649
582
|
|
650
|
-
map
|
651
|
-
pull_java_plugin: :install_java_plugin
|
583
|
+
map pull_java_plugin: :install_java_plugin
|
652
584
|
|
653
585
|
private
|
654
586
|
|
data/lib/kpm/version.rb
CHANGED
data/pom.xml
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
<modelVersion>4.0.0</modelVersion>
|
23
23
|
<groupId>org.kill-bill.billing.installer</groupId>
|
24
24
|
<artifactId>kpm</artifactId>
|
25
|
-
<version>0.
|
25
|
+
<version>0.11.0</version>
|
26
26
|
<packaging>pom</packaging>
|
27
27
|
<name>KPM</name>
|
28
28
|
<description>KPM: the Kill Bill Package Manager</description>
|
@@ -63,12 +63,6 @@ describe KPM::Installer do
|
|
63
63
|
}, {
|
64
64
|
'name' => 'stripe',
|
65
65
|
'version' => '7.0.0'
|
66
|
-
}],
|
67
|
-
'ruby' => [{
|
68
|
-
'name' => 'payment-test-plugin',
|
69
|
-
'artifact_id' => 'payment-test-plugin',
|
70
|
-
'group_id' => 'org.kill-bill.billing.plugin.ruby',
|
71
|
-
'version' => '1.8.7'
|
72
66
|
}]
|
73
67
|
}
|
74
68
|
},
|
@@ -85,10 +79,7 @@ describe KPM::Installer do
|
|
85
79
|
installer.install
|
86
80
|
check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path)
|
87
81
|
|
88
|
-
# Finally verify that for
|
89
|
-
info = installer.install_plugin('payment-test-plugin', nil, 'org.kill-bill.billing.plugin.ruby', 'payment-test-plugin', nil, nil, '1.8.7', plugins_dir)
|
90
|
-
expect(info[:bundle_dir]).to eq plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
|
91
|
-
|
82
|
+
# Finally verify that for (well behaved) java plugins, skipping the install will still correctly return the `:bundle_dir`
|
92
83
|
info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', plugins_dir)
|
93
84
|
expect(info[:bundle_dir]).to eq plugins_dir + '/plugins/java/analytics-plugin/0.7.1'
|
94
85
|
end
|
@@ -105,10 +96,7 @@ describe KPM::Installer do
|
|
105
96
|
plugins_dir + '/plugins/java/analytics-plugin',
|
106
97
|
plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
|
107
98
|
plugins_dir + '/plugins/java/stripe-plugin',
|
108
|
-
plugins_dir + '/plugins/java/stripe-plugin/7.0.0'
|
109
|
-
plugins_dir + '/plugins/ruby',
|
110
|
-
plugins_dir + '/plugins/ruby/killbill-payment-test',
|
111
|
-
plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
|
99
|
+
plugins_dir + '/plugins/java/stripe-plugin/7.0.0'
|
112
100
|
].each do |dir|
|
113
101
|
expect(File.directory?(dir)).to be_truthy
|
114
102
|
end
|
@@ -116,11 +104,9 @@ describe KPM::Installer do
|
|
116
104
|
[
|
117
105
|
kb_webapp_path,
|
118
106
|
kaui_webapp_path,
|
119
|
-
plugins_dir + '/platform/jruby.jar',
|
120
107
|
plugins_dir + '/plugins/plugin_identifiers.json',
|
121
108
|
plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar',
|
122
|
-
plugins_dir + '/plugins/java/stripe-plugin/7.0.0/stripe-plugin-7.0.0.jar'
|
123
|
-
plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7/killbill.properties'
|
109
|
+
plugins_dir + '/plugins/java/stripe-plugin/7.0.0/stripe-plugin-7.0.0.jar'
|
124
110
|
].each do |file|
|
125
111
|
expect(File.file?(file)).to be_truthy
|
126
112
|
end
|
@@ -129,7 +115,7 @@ describe KPM::Installer do
|
|
129
115
|
JSON.parse(f.read)
|
130
116
|
end
|
131
117
|
|
132
|
-
expect(plugin_identifiers.size).to eq
|
118
|
+
expect(plugin_identifiers.size).to eq 2
|
133
119
|
|
134
120
|
expect(plugin_identifiers['analytics']['plugin_name']).to eq 'analytics-plugin'
|
135
121
|
expect(plugin_identifiers['analytics']['group_id']).to eq 'org.kill-bill.billing.plugin.java'
|
@@ -144,12 +130,5 @@ describe KPM::Installer do
|
|
144
130
|
expect(plugin_identifiers['stripe']['packaging']).to eq 'jar'
|
145
131
|
expect(plugin_identifiers['stripe']['version']).to eq '7.0.0'
|
146
132
|
expect(plugin_identifiers['stripe']['language']).to eq 'java'
|
147
|
-
|
148
|
-
expect(plugin_identifiers['payment-test-plugin']['plugin_name']).to eq 'killbill-payment-test'
|
149
|
-
expect(plugin_identifiers['payment-test-plugin']['group_id']).to eq 'org.kill-bill.billing.plugin.ruby'
|
150
|
-
expect(plugin_identifiers['payment-test-plugin']['artifact_id']).to eq 'payment-test-plugin'
|
151
|
-
expect(plugin_identifiers['payment-test-plugin']['packaging']).to eq 'tar.gz'
|
152
|
-
expect(plugin_identifiers['payment-test-plugin']['version']).to eq '1.8.7'
|
153
|
-
expect(plugin_identifiers['payment-test-plugin']['language']).to eq 'ruby'
|
154
133
|
end
|
155
134
|
end
|
@@ -8,30 +8,6 @@ describe KPM::KillbillPluginArtifact do
|
|
8
8
|
@logger.level = Logger::INFO
|
9
9
|
end
|
10
10
|
|
11
|
-
# This test makes sure the top level directory is correctly verify_is_skipped
|
12
|
-
it 'should be able to download and verify .tar.gz ruby artifacts' do
|
13
|
-
# Use the payment-test-plugin as a test, as it is fairly small (2.5M)
|
14
|
-
group_id = 'org.kill-bill.billing.plugin.ruby'
|
15
|
-
artifact_id = 'payment-test-plugin'
|
16
|
-
packaging = 'tar.gz'
|
17
|
-
classifier = nil
|
18
|
-
version = '1.8.7'
|
19
|
-
plugin_name = 'killbill-payment-test'
|
20
|
-
|
21
|
-
Dir.mktmpdir do |dir|
|
22
|
-
info = KPM::KillbillPluginArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, version, plugin_name, dir)
|
23
|
-
expect(info[:file_name]).to be_nil
|
24
|
-
|
25
|
-
files_in_dir = Dir[info[:file_path] + '/*']
|
26
|
-
expect(files_in_dir.size).to eq 1
|
27
|
-
expect(files_in_dir[0]).to eq info[:file_path] + '/killbill-payment-test'
|
28
|
-
|
29
|
-
expect(File.read(info[:file_path] + '/killbill-payment-test/1.8.7/killbill.properties')).to eq "mainClass=PaymentTest::PaymentPlugin\nrequire=payment_test\npluginType=PAYMENT\n"
|
30
|
-
|
31
|
-
expect(info[:bundle_dir]).to eq info[:file_path] + '/killbill-payment-test/1.8.7'
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
11
|
it 'should be able to download and verify artifacts' do
|
36
12
|
Dir.mktmpdir do |dir|
|
37
13
|
sha1_file = dir + '/sha1.yml'
|
@@ -49,24 +25,6 @@ describe KPM::KillbillPluginArtifact do
|
|
49
25
|
|
50
26
|
check_yaml_for_resolved_latest_version(sha1_file, 'org.kill-bill.billing.plugin.java:analytics-plugin:jar', '3.0.0')
|
51
27
|
end
|
52
|
-
|
53
|
-
Dir.mktmpdir do |dir|
|
54
|
-
sha1_file = dir + '/sha1.yml'
|
55
|
-
info = KPM::KillbillPluginArtifact.pull(@logger,
|
56
|
-
KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_GROUP_ID,
|
57
|
-
'logging-plugin',
|
58
|
-
KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_PACKAGING,
|
59
|
-
KPM::BaseArtifact::KILLBILL_RUBY_PLUGIN_CLASSIFIER,
|
60
|
-
'LATEST',
|
61
|
-
'killbill-analytics',
|
62
|
-
dir,
|
63
|
-
sha1_file)
|
64
|
-
|
65
|
-
# No file name - since we untar'ed it
|
66
|
-
expect(info[:file_name]).to be_nil
|
67
|
-
|
68
|
-
check_yaml_for_resolved_latest_version(sha1_file, 'org.kill-bill.billing.plugin.ruby:logging-plugin:tar.gz', '3.0.0')
|
69
|
-
end
|
70
28
|
end
|
71
29
|
|
72
30
|
it 'should be able to list versions' do
|
@@ -79,12 +37,6 @@ describe KPM::KillbillPluginArtifact do
|
|
79
37
|
expect(logging_plugin_versions[0]).to eq '0.6.0'
|
80
38
|
expect(logging_plugin_versions[1]).to eq '0.7.0'
|
81
39
|
expect(logging_plugin_versions[2]).to eq '0.7.1'
|
82
|
-
|
83
|
-
expect(versions[:ruby]).not_to be_nil
|
84
|
-
expect(versions[:ruby]['logging-plugin']).not_to be_nil
|
85
|
-
logging_plugin_versions = versions[:ruby]['logging-plugin'].to_a
|
86
|
-
expect(logging_plugin_versions.size).to be >= 1
|
87
|
-
expect(logging_plugin_versions[0]).to eq '1.7.0'
|
88
40
|
end
|
89
41
|
|
90
42
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.3.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.3.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: thor
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|