kpm 0.7.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +73 -0
- data/Gemfile +2 -0
- data/README.adoc +111 -109
- data/Rakefile +2 -1
- data/bin/kpm +4 -2
- data/kpm.gemspec +8 -6
- data/lib/kpm.rb +3 -0
- data/lib/kpm/account.rb +268 -337
- data/lib/kpm/base_artifact.rb +40 -36
- data/lib/kpm/base_installer.rb +71 -84
- data/lib/kpm/blob.rb +29 -0
- data/lib/kpm/cli.rb +3 -1
- data/lib/kpm/coordinates.rb +6 -9
- data/lib/kpm/database.rb +92 -103
- data/lib/kpm/diagnostic_file.rb +126 -146
- data/lib/kpm/formatter.rb +74 -46
- data/lib/kpm/inspector.rb +22 -32
- data/lib/kpm/installer.rb +53 -46
- data/lib/kpm/kaui_artifact.rb +4 -3
- data/lib/kpm/killbill_plugin_artifact.rb +10 -7
- data/lib/kpm/killbill_server_artifact.rb +24 -10
- data/lib/kpm/migrations.rb +8 -7
- data/lib/kpm/nexus_helper/actions.rb +47 -8
- data/lib/kpm/nexus_helper/nexus_api_calls_v2.rb +87 -94
- data/lib/kpm/nexus_helper/nexus_facade.rb +5 -3
- data/lib/kpm/plugins_directory.rb +14 -9
- data/lib/kpm/plugins_directory.yml +16 -175
- data/lib/kpm/plugins_manager.rb +29 -24
- data/lib/kpm/sha1_checker.rb +56 -15
- data/lib/kpm/system.rb +104 -135
- data/lib/kpm/system_helpers/cpu_information.rb +56 -55
- data/lib/kpm/system_helpers/disk_space_information.rb +60 -63
- data/lib/kpm/system_helpers/entropy_available.rb +37 -39
- data/lib/kpm/system_helpers/memory_information.rb +52 -51
- data/lib/kpm/system_helpers/os_information.rb +45 -47
- data/lib/kpm/system_helpers/system_proxy.rb +10 -10
- data/lib/kpm/tasks.rb +370 -443
- data/lib/kpm/tenant_config.rb +68 -83
- data/lib/kpm/tomcat_manager.rb +9 -8
- data/lib/kpm/trace_logger.rb +18 -16
- data/lib/kpm/uninstaller.rb +81 -14
- data/lib/kpm/utils.rb +13 -14
- data/lib/kpm/version.rb +3 -1
- data/packaging/Gemfile +2 -0
- data/pom.xml +1 -1
- data/spec/kpm/remote/base_artifact_spec.rb +26 -12
- data/spec/kpm/remote/base_installer_spec.rb +30 -29
- data/spec/kpm/remote/installer_spec.rb +74 -72
- data/spec/kpm/remote/kaui_artifact_spec.rb +7 -6
- data/spec/kpm/remote/killbill_plugin_artifact_spec.rb +19 -24
- data/spec/kpm/remote/killbill_server_artifact_spec.rb +30 -13
- data/spec/kpm/remote/migrations_spec.rb +12 -11
- data/spec/kpm/remote/nexus_facade_spec.rb +30 -26
- data/spec/kpm/remote/tenant_config_spec.rb +27 -26
- data/spec/kpm/remote/tomcat_manager_spec.rb +2 -1
- data/spec/kpm/unit/actions_spec.rb +52 -0
- data/spec/kpm/unit/base_artifact_spec.rb +17 -16
- data/spec/kpm/unit/cpu_information_spec.rb +67 -0
- data/spec/kpm/unit/disk_space_information_spec.rb +47 -0
- data/spec/kpm/unit/entropy_information_spec.rb +36 -0
- data/spec/kpm/unit/formatter_spec.rb +163 -0
- data/spec/kpm/unit/inspector_spec.rb +34 -42
- data/spec/kpm/unit/installer_spec.rb +5 -4
- data/spec/kpm/unit/memory_information_spec.rb +102 -0
- data/spec/kpm/unit/os_information_spec.rb +38 -0
- data/spec/kpm/unit/plugins_directory_spec.rb +34 -18
- data/spec/kpm/unit/plugins_manager_spec.rb +61 -65
- data/spec/kpm/unit/sha1_checker_spec.rb +107 -60
- data/spec/kpm/unit/uninstaller_spec.rb +107 -61
- data/spec/kpm/unit_mysql/account_spec.rb +137 -136
- data/spec/spec_helper.rb +19 -17
- data/tasks/package.rake +18 -18
- metadata +19 -34
data/lib/kpm/utils.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'pathname'
|
2
4
|
require 'rubygems/package'
|
3
5
|
require 'zlib'
|
@@ -7,7 +9,7 @@ module KPM
|
|
7
9
|
class << self
|
8
10
|
TAR_LONGLINK = '././@LongLink'
|
9
11
|
|
10
|
-
def unpack_tgz(tar_gz_archive, destination, skip_top_dir=false)
|
12
|
+
def unpack_tgz(tar_gz_archive, destination, skip_top_dir = false)
|
11
13
|
top_dir = nil
|
12
14
|
Gem::Package::TarReader.new(Zlib::GzipReader.open(tar_gz_archive)) do |tar|
|
13
15
|
dest = nil
|
@@ -20,17 +22,17 @@ module KPM
|
|
20
22
|
|
21
23
|
if entry.directory?
|
22
24
|
File.delete dest if File.file? dest
|
23
|
-
FileUtils.mkdir_p dest, :
|
25
|
+
FileUtils.mkdir_p dest, mode: entry.header.mode, verbose: false
|
24
26
|
elsif entry.file?
|
25
27
|
FileUtils.rm_rf dest if File.directory? dest
|
26
|
-
FileUtils.mkdir_p File.dirname(dest), :
|
27
|
-
File.open dest,
|
28
|
+
FileUtils.mkdir_p File.dirname(dest), verbose: false
|
29
|
+
File.open dest, 'wb' do |f|
|
28
30
|
f.print entry.read
|
29
31
|
end
|
30
|
-
FileUtils.chmod entry.header.mode, dest, :
|
32
|
+
FileUtils.chmod entry.header.mode, dest, verbose: false
|
31
33
|
current_dir = File.dirname(dest)
|
32
34
|
# In case there are two top dirs, keep the last one by convention
|
33
|
-
top_dir = current_dir if
|
35
|
+
top_dir = current_dir if top_dir.nil? || top_dir.size >= current_dir.size
|
34
36
|
elsif entry.header.typeflag == '2' # Symlink
|
35
37
|
File.symlink entry.header.linkname, dest
|
36
38
|
end
|
@@ -48,9 +50,7 @@ module KPM
|
|
48
50
|
file_names = []
|
49
51
|
Gem::Package::TarReader.new(Zlib::GzipReader.open(tar_gz_archive)) do |tar|
|
50
52
|
tar.each do |entry|
|
51
|
-
if entry.file?
|
52
|
-
file_names.push entry.full_name
|
53
|
-
end
|
53
|
+
file_names.push entry.full_name if entry.file?
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -62,17 +62,17 @@ module KPM
|
|
62
62
|
ver = get_version_from_file_path(file_path)
|
63
63
|
ext = File.extname(base)
|
64
64
|
|
65
|
-
name = base.gsub(ext,'')
|
65
|
+
name = base.gsub(ext, '')
|
66
66
|
if ver.nil?
|
67
67
|
# this will remove SNAPSHOT and any dash that appear before it (ex --SNAPSHOT).
|
68
|
-
name = name.gsub(/((-+){,1}SNAPSHOT){,1}/,'')
|
68
|
+
name = name.gsub(/((-+){,1}SNAPSHOT){,1}/, '')
|
69
69
|
last_dash = name.rindex('-')
|
70
70
|
name = name[0..last_dash] unless last_dash.nil?
|
71
71
|
else
|
72
|
-
name = name.gsub(ver,'')
|
72
|
+
name = name.gsub(ver, '')
|
73
73
|
end
|
74
74
|
|
75
|
-
name = name[0..name.length-2] if name[-1].match(/[a-zA-z]/).nil?
|
75
|
+
name = name[0..name.length - 2] if name[-1].match(/[a-zA-z]/).nil?
|
76
76
|
name
|
77
77
|
end
|
78
78
|
|
@@ -84,7 +84,6 @@ module KPM
|
|
84
84
|
|
85
85
|
ver[0]
|
86
86
|
end
|
87
|
-
|
88
87
|
end
|
89
88
|
end
|
90
89
|
end
|
data/lib/kpm/version.rb
CHANGED
data/packaging/Gemfile
CHANGED
data/pom.xml
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
<groupId>org.kill-bill.billing.installer</groupId>
|
27
27
|
<artifactId>kpm</artifactId>
|
28
28
|
<packaging>pom</packaging>
|
29
|
-
<version>0.
|
29
|
+
<version>0.8.2</version>
|
30
30
|
<name>KPM</name>
|
31
31
|
<url>http://github.com/killbill/killbill-cloud</url>
|
32
32
|
<description>KPM: the Kill Bill Package Manager</description>
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe KPM::BaseArtifact do
|
4
|
-
|
5
6
|
before(:all) do
|
6
7
|
@logger = Logger.new(STDOUT)
|
7
8
|
@logger.level = Logger::INFO
|
@@ -25,6 +26,23 @@ describe KPM::BaseArtifact do
|
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
29
|
+
it 'should be able to handle download errors' do
|
30
|
+
nexus_down = { url: 'https://does.not.exist' }
|
31
|
+
Dir.mktmpdir do |dir|
|
32
|
+
sha1_file = "#{dir}/sha1.yml"
|
33
|
+
test_download dir, 'foo-oss.pom.xml', false, false, sha1_file
|
34
|
+
# Verify we skip the second time
|
35
|
+
test_download dir, 'foo-oss.pom.xml', true, false, sha1_file
|
36
|
+
# Verify the download is skipped gracefully when Nexus isn't reachable
|
37
|
+
test_download dir, 'foo-oss.pom.xml', true, false, sha1_file, nexus_down
|
38
|
+
# Verify the download fails when Nexus isn't reachable and force_download is set
|
39
|
+
expect { test_download dir, 'foo-oss.pom.xml', nil, true, sha1_file, nexus_down }.to raise_error
|
40
|
+
# Verify the download fails when Nexus isn't reachable and the Nexus cache is empty
|
41
|
+
KPM::Sha1Checker.from_file(sha1_file).cache_artifact_info('org.kill-bill.billing:killbill-oss-parent:pom:0.143.33', nil)
|
42
|
+
expect { test_download dir, 'foo-oss.pom.xml', nil, false, sha1_file, nexus_down }.to raise_error
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
28
46
|
it 'should be able to download and verify generic .tar.gz artifacts' do
|
29
47
|
# The artifact is not small unfortunately (23.7M)
|
30
48
|
group_id = 'org.kill-bill.billing'
|
@@ -38,11 +56,11 @@ describe KPM::BaseArtifact do
|
|
38
56
|
info[:file_name].should be_nil
|
39
57
|
|
40
58
|
files_in_dir = Dir[info[:file_path] + '/*']
|
41
|
-
files_in_dir.size.should
|
59
|
+
files_in_dir.size.should eq 20
|
42
60
|
|
43
61
|
File.file?(info[:file_path] + '/killbill-osgi-bundles-jruby-0.11.3.jar').should be_true
|
44
62
|
|
45
|
-
info[:bundle_dir].should
|
63
|
+
info[:bundle_dir].should eq info[:file_path]
|
46
64
|
end
|
47
65
|
end
|
48
66
|
|
@@ -62,19 +80,15 @@ describe KPM::BaseArtifact do
|
|
62
80
|
second_take = KPM::BaseArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, second_bundle_version, dir)
|
63
81
|
File.file?(first_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.2.jar').should be_false
|
64
82
|
File.file?(second_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.10.jar').should be_true
|
65
|
-
|
66
83
|
end
|
67
84
|
end
|
68
85
|
|
69
|
-
|
70
|
-
def test_download(dir, filename=nil, verify_is_skipped=false, force_download=false)
|
86
|
+
def test_download(dir, filename = nil, verify_is_skipped = false, force_download = false, sha1_file = nil, overrides = {})
|
71
87
|
path = filename.nil? ? dir : dir + '/' + filename
|
72
88
|
|
73
|
-
info = KPM::BaseArtifact.pull(@logger, 'org.kill-bill.billing', 'killbill-oss-parent', 'pom', nil, '
|
74
|
-
info[:file_name].should
|
75
|
-
info[:skipped].should
|
76
|
-
|
77
|
-
info[:size].should == File.size(info[:file_path])
|
78
|
-
end
|
89
|
+
info = KPM::BaseArtifact.pull(@logger, 'org.kill-bill.billing', 'killbill-oss-parent', 'pom', nil, '0.143.33', path, sha1_file, force_download, true, overrides, true)
|
90
|
+
info[:file_name].should eq(filename.nil? ? "killbill-oss-parent-#{info[:version]}.pom" : filename)
|
91
|
+
info[:skipped].should eq verify_is_skipped
|
92
|
+
info[:size].should eq File.size(info[:file_path]) unless info[:skipped]
|
79
93
|
end
|
80
94
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'json'
|
3
5
|
|
4
6
|
describe KPM::BaseInstaller do
|
5
|
-
|
6
7
|
before(:all) do
|
7
8
|
@logger = Logger.new(STDOUT)
|
8
9
|
@logger.level = Logger::INFO
|
@@ -13,7 +14,7 @@ describe KPM::BaseInstaller do
|
|
13
14
|
bundles_dir = dir + '/bundles'
|
14
15
|
installer = KPM::BaseInstaller.new(@logger)
|
15
16
|
|
16
|
-
|
17
|
+
installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', bundles_dir)
|
17
18
|
|
18
19
|
check_installation(bundles_dir)
|
19
20
|
|
@@ -46,23 +47,23 @@ describe KPM::BaseInstaller do
|
|
46
47
|
|
47
48
|
begin
|
48
49
|
installer.install_plugin('invalid', nil, nil, nil, nil, nil, '1.2.3', bundles_dir)
|
49
|
-
|
50
|
-
rescue ArgumentError
|
50
|
+
raise 'Should not succeed to install invalid plugin'
|
51
|
+
rescue ArgumentError
|
52
|
+
# Expected
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
55
57
|
it 'should extract plugin name from file path' do
|
56
|
-
|
57
58
|
[
|
58
|
-
{:
|
59
|
-
{:
|
60
|
-
{:
|
61
|
-
{:
|
62
|
-
{:
|
63
|
-
{:
|
64
|
-
{:
|
65
|
-
{:
|
59
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-1.0.0.jar', expected: 'xxx' },
|
60
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-bar-1.0.0.jar', expected: 'xxx-foo-bar' },
|
61
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.0.0.jar', expected: 'xxx-foo' },
|
62
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.0.0-SNAPSHOT.jar', expected: 'xxx-foo' },
|
63
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.0.jar', expected: 'xxx-foo' },
|
64
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.jar', expected: 'xxx-foo' },
|
65
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-abc-SNAPSHOT.jar', expected: 'xxx-foo' },
|
66
|
+
{ file_path: '/Somewhere/xxx-foo/target/xxx-foo-abc.jar', expected: 'xxx-foo' }
|
66
67
|
].each do |test|
|
67
68
|
KPM::Utils.get_plugin_name_from_file_path(test[:file_path]).should eq test[:expected]
|
68
69
|
end
|
@@ -75,14 +76,14 @@ describe KPM::BaseInstaller do
|
|
75
76
|
|
76
77
|
plugin_identifiers = read_plugin_identifiers(plugins_dir)
|
77
78
|
|
78
|
-
plugin_identifiers.size.should
|
79
|
+
plugin_identifiers.size.should eq 1
|
79
80
|
|
80
|
-
plugin_identifiers['analytics']['plugin_name'].should
|
81
|
-
plugin_identifiers['analytics']['group_id'].should
|
82
|
-
plugin_identifiers['analytics']['artifact_id'].should
|
83
|
-
plugin_identifiers['analytics']['packaging'].should
|
84
|
-
plugin_identifiers['analytics']['version'].should
|
85
|
-
plugin_identifiers['analytics']['language'].should
|
81
|
+
plugin_identifiers['analytics']['plugin_name'].should eq 'analytics-plugin'
|
82
|
+
plugin_identifiers['analytics']['group_id'].should eq 'org.kill-bill.billing.plugin.java'
|
83
|
+
plugin_identifiers['analytics']['artifact_id'].should eq 'analytics-plugin'
|
84
|
+
plugin_identifiers['analytics']['packaging'].should eq 'jar'
|
85
|
+
plugin_identifiers['analytics']['version'].should eq '0.7.1'
|
86
|
+
plugin_identifiers['analytics']['language'].should eq 'java'
|
86
87
|
|
87
88
|
File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt').should be_false
|
88
89
|
end
|
@@ -92,26 +93,26 @@ describe KPM::BaseInstaller do
|
|
92
93
|
|
93
94
|
plugin_identifiers = read_plugin_identifiers(plugins_dir)
|
94
95
|
|
95
|
-
plugin_identifiers.size.should
|
96
|
+
plugin_identifiers.size.should eq 0
|
96
97
|
|
97
98
|
File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt').should be_true
|
98
99
|
end
|
99
100
|
|
100
101
|
def common_checks(plugins_dir)
|
101
102
|
[
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
103
|
+
plugins_dir,
|
104
|
+
plugins_dir + '/plugins',
|
105
|
+
plugins_dir + '/plugins/java',
|
106
|
+
plugins_dir + '/plugins/java/analytics-plugin',
|
107
|
+
plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
|
108
|
+
plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp'
|
108
109
|
].each do |dir|
|
109
110
|
File.directory?(dir).should be_true
|
110
111
|
end
|
111
112
|
|
112
113
|
[
|
113
|
-
|
114
|
-
|
114
|
+
plugins_dir + '/plugins/plugin_identifiers.json',
|
115
|
+
plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar'
|
115
116
|
].each do |file|
|
116
117
|
File.file?(file).should be_true
|
117
118
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'json'
|
3
5
|
|
4
6
|
describe KPM::Installer do
|
5
|
-
|
6
7
|
before(:all) do
|
7
8
|
@logger = Logger.new(STDOUT)
|
8
9
|
@logger.level = Logger::INFO
|
@@ -12,15 +13,15 @@ describe KPM::Installer do
|
|
12
13
|
Dir.mktmpdir do |dir|
|
13
14
|
kb_webapp_path = dir + '/KB_ROOT.war'
|
14
15
|
installer = KPM::Installer.new({
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
'killbill' => {
|
17
|
+
'webapp_path' => kb_webapp_path
|
18
|
+
}
|
18
19
|
},
|
19
20
|
@logger)
|
20
21
|
|
21
22
|
# No exception
|
22
23
|
response = nil
|
23
|
-
expect{ response = installer.install }.to_not raise_exception
|
24
|
+
expect { response = installer.install }.to_not raise_exception
|
24
25
|
response = JSON[response]
|
25
26
|
response['help'].should be_nil
|
26
27
|
response['killbill']['status'].should eq 'INSTALLED'
|
@@ -31,15 +32,15 @@ describe KPM::Installer do
|
|
31
32
|
Dir.mktmpdir do |dir|
|
32
33
|
kaui_webapp_path = dir + '/KAUI_ROOT.war'
|
33
34
|
installer = KPM::Installer.new({
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
'kaui' => {
|
36
|
+
'webapp_path' => kaui_webapp_path
|
37
|
+
}
|
37
38
|
},
|
38
39
|
@logger)
|
39
40
|
|
40
41
|
# No exception
|
41
42
|
response = nil
|
42
|
-
expect{ response = installer.install }.to_not raise_exception
|
43
|
+
expect { response = installer.install }.to_not raise_exception
|
43
44
|
response = JSON[response]
|
44
45
|
response['help'].should be_nil
|
45
46
|
response['kaui']['status'].should eq 'INSTALLED'
|
@@ -52,28 +53,28 @@ describe KPM::Installer do
|
|
52
53
|
kaui_webapp_path = dir + '/KAUI_ROOT.war'
|
53
54
|
plugins_dir = dir + '/bundles'
|
54
55
|
installer = KPM::Installer.new({
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}
|
73
|
-
},
|
74
|
-
'kaui' => {
|
75
|
-
'webapp_path' => kaui_webapp_path
|
56
|
+
'killbill' => {
|
57
|
+
'webapp_path' => kb_webapp_path,
|
58
|
+
'plugins_dir' => plugins_dir,
|
59
|
+
'plugins' => {
|
60
|
+
'java' => [{
|
61
|
+
'name' => 'analytics',
|
62
|
+
'version' => '0.7.1'
|
63
|
+
}, {
|
64
|
+
'name' => 'stripe',
|
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
|
+
}]
|
76
73
|
}
|
74
|
+
},
|
75
|
+
'kaui' => {
|
76
|
+
'webapp_path' => kaui_webapp_path
|
77
|
+
}
|
77
78
|
},
|
78
79
|
@logger)
|
79
80
|
|
@@ -86,11 +87,10 @@ describe KPM::Installer do
|
|
86
87
|
|
87
88
|
# Finally verify that for both (well behaved) ruby and java plugin, skipping the install will still correctly return the `:bundle_dir`
|
88
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)
|
89
|
-
info[:bundle_dir].should
|
90
|
-
|
90
|
+
info[:bundle_dir].should eq plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
|
91
91
|
|
92
|
-
info = installer.install_plugin('analytics', nil, nil, nil,
|
93
|
-
info[:bundle_dir].should
|
92
|
+
info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', plugins_dir)
|
93
|
+
info[:bundle_dir].should eq plugins_dir + '/plugins/java/analytics-plugin/0.7.1'
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
@@ -98,27 +98,29 @@ describe KPM::Installer do
|
|
98
98
|
|
99
99
|
def check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path)
|
100
100
|
[
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
101
|
+
plugins_dir,
|
102
|
+
plugins_dir + '/platform',
|
103
|
+
plugins_dir + '/plugins',
|
104
|
+
plugins_dir + '/plugins/java',
|
105
|
+
plugins_dir + '/plugins/java/analytics-plugin',
|
106
|
+
plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
|
107
|
+
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'
|
111
112
|
].each do |dir|
|
112
113
|
File.directory?(dir).should be_true
|
113
114
|
end
|
114
115
|
|
115
116
|
[
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
117
|
+
kb_webapp_path,
|
118
|
+
kaui_webapp_path,
|
119
|
+
plugins_dir + '/platform/jruby.jar',
|
120
|
+
plugins_dir + '/plugins/plugin_identifiers.json',
|
121
|
+
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'
|
122
124
|
].each do |file|
|
123
125
|
File.file?(file).should be_true
|
124
126
|
end
|
@@ -127,27 +129,27 @@ describe KPM::Installer do
|
|
127
129
|
JSON.parse(f.read)
|
128
130
|
end
|
129
131
|
|
130
|
-
plugin_identifiers.size.should
|
131
|
-
|
132
|
-
plugin_identifiers['analytics']['plugin_name'].should
|
133
|
-
plugin_identifiers['analytics']['group_id'].should
|
134
|
-
plugin_identifiers['analytics']['artifact_id'].should
|
135
|
-
plugin_identifiers['analytics']['packaging'].should
|
136
|
-
plugin_identifiers['analytics']['version'].should
|
137
|
-
plugin_identifiers['analytics']['language'].should
|
138
|
-
|
139
|
-
plugin_identifiers['
|
140
|
-
plugin_identifiers['
|
141
|
-
plugin_identifiers['
|
142
|
-
plugin_identifiers['
|
143
|
-
plugin_identifiers['
|
144
|
-
plugin_identifiers['
|
145
|
-
|
146
|
-
plugin_identifiers['
|
147
|
-
plugin_identifiers['
|
148
|
-
plugin_identifiers['
|
149
|
-
plugin_identifiers['
|
150
|
-
plugin_identifiers['
|
151
|
-
plugin_identifiers['
|
132
|
+
plugin_identifiers.size.should eq 3
|
133
|
+
|
134
|
+
plugin_identifiers['analytics']['plugin_name'].should eq 'analytics-plugin'
|
135
|
+
plugin_identifiers['analytics']['group_id'].should eq 'org.kill-bill.billing.plugin.java'
|
136
|
+
plugin_identifiers['analytics']['artifact_id'].should eq 'analytics-plugin'
|
137
|
+
plugin_identifiers['analytics']['packaging'].should eq 'jar'
|
138
|
+
plugin_identifiers['analytics']['version'].should eq '0.7.1'
|
139
|
+
plugin_identifiers['analytics']['language'].should eq 'java'
|
140
|
+
|
141
|
+
plugin_identifiers['stripe']['plugin_name'].should eq 'stripe-plugin'
|
142
|
+
plugin_identifiers['stripe']['group_id'].should eq 'org.kill-bill.billing.plugin.java'
|
143
|
+
plugin_identifiers['stripe']['artifact_id'].should eq 'stripe-plugin'
|
144
|
+
plugin_identifiers['stripe']['packaging'].should eq 'jar'
|
145
|
+
plugin_identifiers['stripe']['version'].should eq '7.0.0'
|
146
|
+
plugin_identifiers['stripe']['language'].should eq 'java'
|
147
|
+
|
148
|
+
plugin_identifiers['payment-test-plugin']['plugin_name'].should eq 'killbill-payment-test'
|
149
|
+
plugin_identifiers['payment-test-plugin']['group_id'].should eq 'org.kill-bill.billing.plugin.ruby'
|
150
|
+
plugin_identifiers['payment-test-plugin']['artifact_id'].should eq 'payment-test-plugin'
|
151
|
+
plugin_identifiers['payment-test-plugin']['packaging'].should eq 'tar.gz'
|
152
|
+
plugin_identifiers['payment-test-plugin']['version'].should eq '1.8.7'
|
153
|
+
plugin_identifiers['payment-test-plugin']['language'].should eq 'ruby'
|
152
154
|
end
|
153
155
|
end
|