killbill-kpm 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile.lock +31 -12
- data/Jarfile.lock +61 -61
- data/VERSION +1 -1
- data/killbill-kpm.gemspec +3 -3
- data/lib/kpm/listener.rb +22 -2
- data/lib/kpm/plugins_installer.rb +7 -10
- data/pom.xml +1 -1
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 715d9f8fc066bae68d3d1e9a9ce01c771aaab8b7
|
4
|
+
data.tar.gz: 667e8cc8697f1035e345c1c4e1a86c2c757567c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39f91520cd76ef82c8f07db0cea42a8134d7315d98901b80847708ca83e8194f1fffda6f42969b4b99ed9b42147fb1bbf6979046d2d041b3ea9399dbe1c4263f
|
7
|
+
data.tar.gz: b05c93f91b7b20034aa61587407779fd44a534677895a52fd1b60872ab9c2ff4ad12d1e17c18ffc1cbf9eec5a0ead7a7cfb9d6844325d2fe6e11d09777479be8
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
killbill-kpm (0.0.
|
5
|
-
killbill (~> 7.0
|
6
|
-
kpm (~> 0.1.
|
4
|
+
killbill-kpm (0.0.5)
|
5
|
+
killbill (~> 7.0)
|
6
|
+
kpm (~> 0.1.4)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -11,11 +11,20 @@ GEM
|
|
11
11
|
activesupport (3.2.22)
|
12
12
|
i18n (~> 0.6, >= 0.6.4)
|
13
13
|
multi_json (~> 1.0)
|
14
|
+
axiom-types (0.1.1)
|
15
|
+
descendants_tracker (~> 0.0.4)
|
16
|
+
ice_nine (~> 0.11.0)
|
17
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
14
18
|
chozo (0.6.1)
|
15
19
|
activesupport (>= 3.2.0)
|
16
20
|
hashie (>= 2.0.2)
|
17
21
|
multi_json (>= 1.3.0)
|
22
|
+
coercible (1.0.0)
|
23
|
+
descendants_tracker (~> 0.0.1)
|
24
|
+
descendants_tracker (0.0.4)
|
25
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
18
26
|
diff-lcs (1.1.3)
|
27
|
+
equalizer (0.0.11)
|
19
28
|
ethon (0.8.0)
|
20
29
|
ffi (>= 1.3.0)
|
21
30
|
extlib (0.9.16)
|
@@ -24,9 +33,13 @@ GEM
|
|
24
33
|
highline (1.6.21)
|
25
34
|
httpclient (2.2.5)
|
26
35
|
i18n (0.7.0)
|
27
|
-
|
28
|
-
|
29
|
-
|
36
|
+
ice_nine (0.11.1)
|
37
|
+
jar-dependencies (0.3.1)
|
38
|
+
jbundler (0.9.2)
|
39
|
+
bundler (~> 1.5)
|
40
|
+
jar-dependencies (~> 0.2)
|
41
|
+
maven-tools (~> 1.0.10)
|
42
|
+
ruby-maven (~> 3.3, >= 3.3.3)
|
30
43
|
json (1.8.3-java)
|
31
44
|
jsonpath (0.5.8)
|
32
45
|
multi_json
|
@@ -35,11 +48,12 @@ GEM
|
|
35
48
|
sinatra (~> 1.3.4)
|
36
49
|
typhoeus (~> 0.6.9)
|
37
50
|
tzinfo (~> 1.2.0)
|
38
|
-
kpm (0.1.
|
51
|
+
kpm (0.1.4)
|
39
52
|
highline (~> 1.6.21)
|
40
53
|
nexus_cli (~> 4.1.0)
|
41
54
|
thor (~> 0.19.1)
|
42
|
-
maven-tools (0.
|
55
|
+
maven-tools (1.0.13)
|
56
|
+
virtus (~> 1.0)
|
43
57
|
multi_json (1.11.2)
|
44
58
|
nexus_cli (4.1.0)
|
45
59
|
activesupport (~> 3.2.0)
|
@@ -62,9 +76,9 @@ GEM
|
|
62
76
|
rspec-expectations (2.12.1)
|
63
77
|
diff-lcs (~> 1.1.3)
|
64
78
|
rspec-mocks (2.12.2)
|
65
|
-
ruby-maven (3.
|
66
|
-
maven-
|
67
|
-
|
79
|
+
ruby-maven (3.3.8)
|
80
|
+
ruby-maven-libs (~> 3.3.1)
|
81
|
+
ruby-maven-libs (3.3.3)
|
68
82
|
sinatra (1.3.6)
|
69
83
|
rack (~> 1.4)
|
70
84
|
rack-protection (~> 1.3)
|
@@ -76,12 +90,17 @@ GEM
|
|
76
90
|
ethon (>= 0.7.1)
|
77
91
|
tzinfo (1.2.2)
|
78
92
|
thread_safe (~> 0.1)
|
93
|
+
virtus (1.0.5)
|
94
|
+
axiom-types (~> 0.1)
|
95
|
+
coercible (~> 1.0)
|
96
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
97
|
+
equalizer (~> 0.0, >= 0.0.9)
|
79
98
|
|
80
99
|
PLATFORMS
|
81
100
|
java
|
82
101
|
|
83
102
|
DEPENDENCIES
|
84
|
-
jbundler (~> 0.
|
103
|
+
jbundler (~> 0.9.2)
|
85
104
|
killbill-kpm!
|
86
105
|
rake (>= 10.0.0)
|
87
106
|
rspec (~> 2.12.0)
|
data/Jarfile.lock
CHANGED
@@ -1,61 +1,61 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
org.kill-bill.billing.plugin:killbill-plugin-api-
|
5
|
-
|
6
|
-
|
7
|
-
org.
|
8
|
-
org.kill-bill.billing.plugin:killbill-plugin-api-
|
9
|
-
|
10
|
-
org.kill-bill.billing
|
11
|
-
org.kill-bill.
|
12
|
-
|
13
|
-
com.
|
14
|
-
|
15
|
-
|
16
|
-
com.samskivert:jmustache:jar:1.5
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
org.
|
23
|
-
|
24
|
-
|
25
|
-
org.
|
26
|
-
commons
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
org.
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
org.
|
36
|
-
org.
|
37
|
-
org.kill-bill.billing:killbill-
|
38
|
-
org.kill-bill.billing:killbill-platform-
|
39
|
-
org.
|
40
|
-
|
41
|
-
org.
|
42
|
-
org.kill-bill.
|
43
|
-
org.
|
44
|
-
org.kill-bill.billing:killbill-platform-osgi:jar:0.15
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
org.kill-bill.commons:killbill-
|
49
|
-
org.
|
50
|
-
org.kill-bill.commons:killbill-
|
51
|
-
|
52
|
-
|
53
|
-
org.
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
org.
|
59
|
-
org.
|
60
|
-
org.
|
61
|
-
|
1
|
+
---
|
2
|
+
:runtime:
|
3
|
+
- io.dropwizard.metrics:metrics-core:jar:3.1.1
|
4
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-catalog:jar:0.18
|
5
|
+
- com.fasterxml.jackson.core:jackson-core:jar:2.4.3
|
6
|
+
- joda-time:joda-time:jar:2.3
|
7
|
+
- org.weakref:jmxutils:jar:1.18
|
8
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-notification:jar:0.18
|
9
|
+
- commons-beanutils:commons-beanutils:jar:1.8.3
|
10
|
+
- org.kill-bill.billing:killbill-internal-api:jar:0.15.10
|
11
|
+
- org.kill-bill.commons:killbill-xmlloader:jar:0.11
|
12
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-entitlement:jar:0.18
|
13
|
+
- com.google.inject:guice:jar:3.0
|
14
|
+
- org.osgi:org.osgi.core:jar:5.0.0
|
15
|
+
- org.slf4j:slf4j-api:jar:1.7.12
|
16
|
+
- com.samskivert:jmustache:jar:1.5
|
17
|
+
- org.kill-bill.billing:killbill-util:jar:tests:0.15.10
|
18
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-currency:jar:0.18
|
19
|
+
- org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4:jar:1.16
|
20
|
+
- com.h2database:h2:jar:1.4.186
|
21
|
+
- javax.activation:activation:jar:1.1
|
22
|
+
- org.skife.config:config-magic:jar:0.14
|
23
|
+
- com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.4.3
|
24
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-control:jar:0.18
|
25
|
+
- org.mockito:mockito-all:jar:1.10.19
|
26
|
+
- org.apache.commons:commons-email:jar:1.2
|
27
|
+
- antlr:antlr:jar:2.7.7
|
28
|
+
- aopalliance:aopalliance:jar:1.0
|
29
|
+
- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.3
|
30
|
+
- org.antlr:stringtemplate:jar:3.2.1
|
31
|
+
- org.kill-bill.commons:killbill-clock:jar:0.11
|
32
|
+
- javax.mail:mail:jar:1.4.1
|
33
|
+
- org.kill-bill.billing:killbill-platform-base:jar:0.15
|
34
|
+
- io.dropwizard.metrics:metrics-ehcache:jar:3.1.1
|
35
|
+
- org.slf4j:jcl-over-slf4j:jar:1.7.12
|
36
|
+
- org.jdbi:jdbi:jar:2.62
|
37
|
+
- org.kill-bill.billing:killbill-platform-api:jar:0.15
|
38
|
+
- org.kill-bill.billing:killbill-platform-osgi:jar:0.15
|
39
|
+
- org.apache.felix:org.apache.felix.framework:jar:4.4.1
|
40
|
+
- org.joda:joda-money:jar:0.9
|
41
|
+
- org.kill-bill.commons:killbill-jdbi:jar:0.11
|
42
|
+
- org.kill-bill.commons:killbill-embeddeddb-common:jar:0.11
|
43
|
+
- org.apache.shiro:shiro-core:jar:1.2.3
|
44
|
+
- org.kill-bill.billing:killbill-platform-osgi-api:jar:0.15
|
45
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-payment:jar:0.18
|
46
|
+
- com.fasterxml.jackson.core:jackson-databind:jar:2.4.3
|
47
|
+
- com.google.guava:guava:jar:r09
|
48
|
+
- org.kill-bill.commons:killbill-locker:jar:0.11
|
49
|
+
- org.osgi:org.osgi.compendium:jar:5.0.0
|
50
|
+
- org.kill-bill.commons:killbill-queue:jar:0.11
|
51
|
+
- javax.servlet:javax.servlet-api:jar:3.1.0
|
52
|
+
- org.kill-bill.commons:killbill-concurrent:jar:0.11
|
53
|
+
- org.apache.shiro:shiro-ehcache:jar:1.2.3
|
54
|
+
- javax.inject:javax.inject:jar:1
|
55
|
+
- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.4.3
|
56
|
+
- com.google.inject.extensions:guice-multibindings:jar:3.0
|
57
|
+
- net.sf.ehcache:ehcache:jar:2.9.1
|
58
|
+
- org.kill-bill.billing:killbill-api:jar:0.32
|
59
|
+
- org.kill-bill.billing.plugin:killbill-plugin-api-invoice:jar:0.18
|
60
|
+
- org.apache.shiro:shiro-guice:jar:1.2.3
|
61
|
+
- com.google.code.findbugs:annotations:jar:3.0.0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/killbill-kpm.gemspec
CHANGED
@@ -22,10 +22,10 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.rdoc_options << '--exclude' << '.'
|
24
24
|
|
25
|
-
s.add_dependency 'killbill', '~> 7.0
|
26
|
-
s.add_dependency 'kpm', '~> 0.1.
|
25
|
+
s.add_dependency 'killbill', '~> 7.0'
|
26
|
+
s.add_dependency 'kpm', '~> 0.1.4'
|
27
27
|
|
28
|
-
s.add_development_dependency 'jbundler', '~> 0.
|
28
|
+
s.add_development_dependency 'jbundler', '~> 0.9.2'
|
29
29
|
s.add_development_dependency 'rake', '>= 10.0.0'
|
30
30
|
s.add_development_dependency 'rspec', '~> 2.12.0'
|
31
31
|
end
|
data/lib/kpm/listener.rb
CHANGED
@@ -3,13 +3,16 @@ require 'nexus_cli'
|
|
3
3
|
module KPM
|
4
4
|
class Listener < Killbill::Plugin::Notification
|
5
5
|
|
6
|
+
|
6
7
|
def start_plugin
|
7
8
|
super
|
8
|
-
|
9
9
|
::KPM::PluginsInstaller.instance.initialize!(@root, @conf_dir, @kb_apis, @logger)
|
10
|
+
# We don't know yet
|
11
|
+
@kb_version = nil
|
10
12
|
end
|
11
13
|
|
12
14
|
def on_event(event)
|
15
|
+
|
13
16
|
return unless [:BROADCAST_SERVICE].include?(event.event_type)
|
14
17
|
|
15
18
|
unless ::KPM::PluginsInstaller.instance.initialized?
|
@@ -47,11 +50,28 @@ module KPM
|
|
47
50
|
|
48
51
|
private
|
49
52
|
|
53
|
+
def get_kb_version
|
54
|
+
return @kb_version if @kb_version
|
55
|
+
|
56
|
+
nodes_info = @kb_apis.killbill_nodes_api.get_nodes_info
|
57
|
+
if nodes_info.nil? || nodes_info.empty?
|
58
|
+
@logger.warn("Unable to retrieve node info")
|
59
|
+
end
|
60
|
+
|
61
|
+
# This is incorrect, we need to find the entry for our node, but we don't seem to know who we are -:(
|
62
|
+
# (The will break in rolling upgrade scenario)
|
63
|
+
@kb_version = nodes_info[0].killbill_version
|
64
|
+
|
65
|
+
@logger.info("KPM plugin extracted killbill version #{@kb_version}")
|
66
|
+
|
67
|
+
@kb_version
|
68
|
+
end
|
69
|
+
|
50
70
|
def handle_event(command, plugin_key, artifact_id, version=nil, group_id=nil, packaging=nil, classifier=nil, type=nil, force_download=false)
|
51
71
|
@logger.info "handle_event command=#{command}, plugin_key=#{plugin_key}, artifact_id=#{artifact_id}, version=#{version}, group_id=#{group_id}, packaging=#{packaging}, classifier=#{classifier}, type=#{type}, force_download=#{force_download}"
|
52
72
|
|
53
73
|
if command == 'INSTALL_PLUGIN'
|
54
|
-
::KPM::PluginsInstaller.instance.install(plugin_key, artifact_id, version, group_id, packaging, classifier, type, force_download)
|
74
|
+
::KPM::PluginsInstaller.instance.install(plugin_key, get_kb_version, artifact_id, version, group_id, packaging, classifier, type, force_download)
|
55
75
|
elsif command == 'UNINSTALL_PLUGIN'
|
56
76
|
::KPM::PluginsInstaller.instance.uninstall(plugin_key, version)
|
57
77
|
else
|
@@ -21,13 +21,13 @@ module KPM
|
|
21
21
|
end
|
22
22
|
|
23
23
|
# If an earlier version of the plugin is installed, Kill Bill will only start the latest one (see org.killbill.billing.osgi.FileInstall)
|
24
|
-
def install(plugin_key, specified_artifact_id, specified_version=nil, specified_group_id=nil, specified_packaging=nil, specified_classifier=nil, specified_type=nil, force_download=false)
|
24
|
+
def install(plugin_key, kb_version, specified_artifact_id, specified_version=nil, specified_group_id=nil, specified_packaging=nil, specified_classifier=nil, specified_type=nil, force_download=false)
|
25
25
|
@logger.info("Instructed to install plugin_key=#{plugin_key} artifact_id=#{specified_artifact_id} version=#{specified_version} group_id=#{specified_group_id} packaging=#{specified_packaging} classifier=#{specified_classifier} type=#{specified_type} force_download=#{force_download}")
|
26
|
-
info = @installer.install_plugin(plugin_key, specified_group_id, specified_artifact_id, specified_packaging, specified_classifier, specified_version, @bundles_dir, specified_type, force_download, @glob_config[:kpm][:verify_sha1])
|
26
|
+
info = @installer.install_plugin(plugin_key, kb_version, specified_group_id, specified_artifact_id, specified_packaging, specified_classifier, specified_version, @bundles_dir, specified_type, force_download, @glob_config[:kpm][:verify_sha1])
|
27
27
|
if info.nil?
|
28
28
|
@logger.warn("Error during installation of plugin #{specified_artifact_id}")
|
29
29
|
else
|
30
|
-
path = info[:bundle_dir]
|
30
|
+
path = info[:bundle_dir]
|
31
31
|
notify_fs_change(plugin_key, path, :NEW_VERSION)
|
32
32
|
end
|
33
33
|
info
|
@@ -69,23 +69,20 @@ module KPM
|
|
69
69
|
def notify_fs_change(plugin_key, path, state)
|
70
70
|
return if path.nil?
|
71
71
|
|
72
|
+
@logger.info("notify_fs_change: plugin_key = #{plugin_key}, path=#{path}, state=#{state}")
|
73
|
+
|
72
74
|
# Plugin name should be the directory name (path is something like /var/tmp/bundles/plugins/ruby/killbill-stripe/2.0.0 or /var/tmp/bundles/plugins/ruby)
|
73
75
|
fs_info = path.to_s.split('/')
|
74
76
|
plugin_type = fs_info[-3].upcase
|
75
|
-
|
77
|
+
plugin_name = fs_info[-2]
|
78
|
+
plugin_version = fs_info[-1]
|
76
79
|
|
77
|
-
unless %w(JAVA RUBY).include?(plugin_type)
|
78
|
-
@logger.warn("Invalid plugin type #{plugin_type} (path #{path}): Kill Bill won't be notified of new state #{state}")
|
79
|
-
return
|
80
|
-
end
|
81
80
|
|
82
81
|
if @kb_apis.nil?
|
83
82
|
@logger.warn("APIs not configured: Kill Bill won't be notified of new state #{state}")
|
84
83
|
return
|
85
84
|
end
|
86
85
|
|
87
|
-
plugin_name = fs_info[-2]
|
88
|
-
plugin_version = fs_info[-1]
|
89
86
|
@logger.info("Notifying Kill Bill: state=#{state} plugin_key=#{plugin_key} plugin_name=#{plugin_name} plugin_version=#{plugin_version} plugin_type=#{plugin_type}")
|
90
87
|
@kb_apis.plugins_info_api.notify_of_state_changed(state, plugin_key, plugin_name, plugin_version, plugin_type)
|
91
88
|
end
|
data/pom.xml
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
<groupId>org.kill-bill.billing.plugin.ruby</groupId>
|
26
26
|
<artifactId>kpm-plugin</artifactId>
|
27
27
|
<packaging>pom</packaging>
|
28
|
-
<version>0.0.
|
28
|
+
<version>0.0.5</version>
|
29
29
|
<name>kpm-plugin</name>
|
30
30
|
<url>http://github.com/killbill/killbill-kpm-plugin</url>
|
31
31
|
<description>Kill Bill KPM plugin</description>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-kpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Killbill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: killbill
|
@@ -16,12 +16,12 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.0
|
19
|
+
version: '7.0'
|
20
20
|
requirement: !ruby/object:Gem::Requirement
|
21
21
|
requirements:
|
22
22
|
- - ~>
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 7.0
|
24
|
+
version: '7.0'
|
25
25
|
prerelease: false
|
26
26
|
type: :runtime
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -30,12 +30,12 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
33
|
+
version: 0.1.4
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
36
|
- - ~>
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: 0.1.
|
38
|
+
version: 0.1.4
|
39
39
|
prerelease: false
|
40
40
|
type: :runtime
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -44,12 +44,12 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.9.2
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - ~>
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.
|
52
|
+
version: 0.9.2
|
53
53
|
prerelease: false
|
54
54
|
type: :development
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -130,8 +130,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.4.6
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Kill Bill KPM plugin
|
137
|
-
test_files:
|
137
|
+
test_files:
|
138
|
+
- spec/kpm/base_plugin_spec.rb
|
139
|
+
- spec/spec_helper.rb
|