kpm 0.2.3 → 0.2.4
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 +4 -4
- data/lib/kpm/base_artifact.rb +9 -5
- data/lib/kpm/installer.rb +2 -1
- data/lib/kpm/version.rb +1 -1
- data/spec/kpm/remote/installer_spec.rb +30 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0889ae583673bb8168b34853243ea0e2a88f97e0
|
4
|
+
data.tar.gz: 56ac52db997d07403c2950e673d6677c1c116703
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12d0020758ace9cf0ea3de62d2f136f06c8e9ac97a08a8ff7805523f8945b8640e8f2ad2ce3642a3dbb03c53cb578625acc7eb10a9b4650f17bc93c67879bede
|
7
|
+
data.tar.gz: 9d941fbca6145ce2e94cbb5b660b266f07cbab65a2c02077369184e581795f1a76138a7dd55ed63c7591fc1b1a43003c42848e018fdff5c30b14025644d19ad6
|
data/lib/kpm/base_artifact.rb
CHANGED
@@ -140,7 +140,6 @@ module KPM
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def skip_if_exists(artifact_info, coordinates, sha1_file)
|
143
|
-
|
144
143
|
# If there is no sha1 from the binary server, we don't skip
|
145
144
|
# (Unclear if this is even possible)
|
146
145
|
return false if artifact_info[:sha1].nil?
|
@@ -154,11 +153,16 @@ module KPM
|
|
154
153
|
sha1_checker = Sha1Checker.from_file(sha1_file)
|
155
154
|
local_sha1 = sha1_checker.sha1(coordinates)
|
156
155
|
|
157
|
-
#
|
158
|
-
|
159
|
-
return true if local_sha1 == artifact_info[:sha1] || local_sha1 == 'SKIP'
|
156
|
+
# Support convenient 'SKIP' keyword for allowing hacking deployments (dev mode)
|
157
|
+
return true if local_sha1 == 'SKIP'
|
160
158
|
|
161
|
-
|
159
|
+
if artifact_info[:is_tgz]
|
160
|
+
# For Ruby plugins, if there is an entry in the sha1_file and it matches the remote, we can skip
|
161
|
+
local_sha1 == artifact_info[:sha1]
|
162
|
+
else
|
163
|
+
# For Java plugins and other artifacts, verify the file is still around
|
164
|
+
local_sha1 == artifact_info[:sha1] && File.file?(artifact_info[:file_path])
|
165
|
+
end
|
162
166
|
end
|
163
167
|
|
164
168
|
def artifact_info(logger, coordinate_map, overrides={}, ssl_verify=true)
|
data/lib/kpm/installer.rb
CHANGED
@@ -52,8 +52,9 @@ module KPM
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def install(force_download=false, verify_sha1=true)
|
55
|
+
bundles_dir = !@config.nil? ? @config['plugins_dir'] : (!@kaui_config.nil? ? @kaui_config['plugins_dir'] : nil)
|
56
|
+
bundles_dir ||= DEFAULT_BUNDLES_DIR
|
55
57
|
|
56
|
-
bundles_dir = @config['plugins_dir'] || DEFAULT_BUNDLES_DIR
|
57
58
|
help = nil
|
58
59
|
unless @config.nil?
|
59
60
|
help = install_tomcat if @config['webapp_path'].nil?
|
data/lib/kpm/version.rb
CHANGED
@@ -8,6 +8,36 @@ describe KPM::Installer do
|
|
8
8
|
@logger.level = Logger::INFO
|
9
9
|
end
|
10
10
|
|
11
|
+
it 'should be able to install only Kill Bill' do
|
12
|
+
Dir.mktmpdir do |dir|
|
13
|
+
kb_webapp_path = dir + '/KB_ROOT.war'
|
14
|
+
installer = KPM::Installer.new({
|
15
|
+
'killbill' => {
|
16
|
+
'webapp_path' => kb_webapp_path
|
17
|
+
}
|
18
|
+
},
|
19
|
+
@logger)
|
20
|
+
|
21
|
+
# No exception
|
22
|
+
installer.install.should be_nil
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should be able to install only Kaui' do
|
27
|
+
Dir.mktmpdir do |dir|
|
28
|
+
kaui_webapp_path = dir + '/KAUI_ROOT.war'
|
29
|
+
installer = KPM::Installer.new({
|
30
|
+
'kaui' => {
|
31
|
+
'webapp_path' => kaui_webapp_path
|
32
|
+
}
|
33
|
+
},
|
34
|
+
@logger)
|
35
|
+
|
36
|
+
# No exception
|
37
|
+
installer.install.should be_nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
11
41
|
it 'should be able to install all artifacts' do
|
12
42
|
Dir.mktmpdir do |dir|
|
13
43
|
kb_webapp_path = dir + '/KB_ROOT.war'
|
@@ -36,7 +66,6 @@ describe KPM::Installer do
|
|
36
66
|
'kaui' => {
|
37
67
|
'webapp_path' => kaui_webapp_path
|
38
68
|
}
|
39
|
-
|
40
69
|
},
|
41
70
|
@logger)
|
42
71
|
|
@@ -54,14 +83,12 @@ describe KPM::Installer do
|
|
54
83
|
|
55
84
|
info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', plugins_dir)
|
56
85
|
info[:bundle_dir].should == plugins_dir + '/plugins/java/analytics-plugin/0.7.1'
|
57
|
-
|
58
86
|
end
|
59
87
|
end
|
60
88
|
|
61
89
|
private
|
62
90
|
|
63
91
|
def check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path)
|
64
|
-
|
65
92
|
[
|
66
93
|
plugins_dir,
|
67
94
|
plugins_dir + '/platform',
|
@@ -114,6 +141,5 @@ describe KPM::Installer do
|
|
114
141
|
plugin_identifiers['stripe']['packaging'].should == 'tar.gz'
|
115
142
|
plugin_identifiers['stripe']['version'].should == '2.0.0'
|
116
143
|
plugin_identifiers['stripe']['language'].should == 'ruby'
|
117
|
-
|
118
144
|
end
|
119
145
|
end
|
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.2.
|
4
|
+
version: 0.2.4
|
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: 2016-
|
11
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|