kpm 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/kpm.gemspec +1 -1
- data/lib/kpm.rb +1 -0
- data/lib/kpm/account.rb +24 -29
- data/lib/kpm/plugins_directory.yml +4 -4
- data/lib/kpm/tasks.rb +52 -0
- data/lib/kpm/tenant_config.rb +131 -0
- data/lib/kpm/version.rb +1 -1
- data/spec/kpm/remote/tenant_config_spec.rb +58 -0
- data/spec/kpm/remote/tenant_config_spec.yml +7 -0
- data/spec/kpm/unit_mysql/account_spec.rb +3 -13
- data/spec/spec_helper.rb +18 -0
- metadata +37 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be3b3dacc891388365ba4094b09108090506210
|
4
|
+
data.tar.gz: 851500df67953047390b991a8379861adf8fcd6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26ac12031991b00e25eb1c790801a7dfb624ec54d0eb745ee0c860aa01ebfdf27a34154a028002dde4c9aed100883ee8bc6a7cc935d3cc41bae755193d637b69
|
7
|
+
data.tar.gz: 3279ae222cfdf26b8b1d844ef286d157b1dff9c5a660e9b188ec9db4d14ba3b6b07d6dfff43f77e14c642265228c627c63c9c339e5a0089aaa429663b879f104
|
data/kpm.gemspec
CHANGED
@@ -43,9 +43,9 @@ Gem::Specification.new do |s|
|
|
43
43
|
s.add_dependency 'nexus_cli', '~> 4.1.0'
|
44
44
|
s.add_dependency 'thor', '~> 0.19.1'
|
45
45
|
s.add_dependency 'rubyzip', '~>1.2.0'
|
46
|
+
s.add_dependency 'killbill-client', '~> 1.0'
|
46
47
|
|
47
48
|
s.add_development_dependency 'rake', '>= 10.0.0', '< 11.0.0'
|
48
49
|
s.add_development_dependency 'rspec', '~> 2.12.0'
|
49
|
-
s.add_development_dependency 'killbill-client', '~> 1.0'
|
50
50
|
end
|
51
51
|
|
data/lib/kpm.rb
CHANGED
data/lib/kpm/account.rb
CHANGED
@@ -3,6 +3,7 @@ require 'tmpdir'
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'date'
|
5
5
|
require 'securerandom'
|
6
|
+
require 'killbill_client'
|
6
7
|
|
7
8
|
module KPM
|
8
9
|
|
@@ -65,7 +66,7 @@ module KPM
|
|
65
66
|
:tag_history => {:id => :tag_history_id, :object_id => nil},
|
66
67
|
:audit_log => {:id => :audit_log_id}
|
67
68
|
}
|
68
|
-
|
69
|
+
|
69
70
|
#delimeters to sniff
|
70
71
|
DELIMITERS = [',','|']
|
71
72
|
DEFAULT_DELIMITER = "|"
|
@@ -121,7 +122,7 @@ module KPM
|
|
121
122
|
raise Interrupt, 'Need to specify a valid file'
|
122
123
|
end
|
123
124
|
|
124
|
-
@delimiter = sniff_delimiter(source_file) || @delimiter
|
125
|
+
@delimiter = sniff_delimiter(source_file) || @delimiter
|
125
126
|
|
126
127
|
sanitize_and_import(source_file, skip_payment_methods)
|
127
128
|
end
|
@@ -130,27 +131,21 @@ module KPM
|
|
130
131
|
|
131
132
|
# export helpers: fetch_export_data; export; process_export_data; remove_export_data;
|
132
133
|
def fetch_export_data(account_id)
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
response = Net::HTTP.start(uri.host,uri.port) do |http|
|
142
|
-
http.request(request)
|
143
|
-
end
|
144
|
-
|
145
|
-
if response.to_s.include? 'HTTPUnauthorized'
|
146
|
-
raise Interrupt, "User is unauthorized -> \e[93mUser[#{@killbill_user}],password[#{@killbill_password}],api_key[#{@killbill_api_key}],api_secret[#{@killbill_api_secrets}]\e[0m"
|
147
|
-
end
|
134
|
+
KillBillClient.url = @killbill_url
|
135
|
+
options = {
|
136
|
+
:username => @killbill_user,
|
137
|
+
:password => @killbill_password,
|
138
|
+
:api_key => @killbill_api_key,
|
139
|
+
:api_secret => @killbill_api_secrets
|
140
|
+
}
|
148
141
|
|
149
|
-
|
142
|
+
begin
|
143
|
+
account_data = KillBillClient::Model::Export.find_by_account_id(account_id, 'KPM', options)
|
144
|
+
rescue Exception => e
|
150
145
|
raise Interrupt, 'Account id not found'
|
151
146
|
end
|
152
147
|
|
153
|
-
|
148
|
+
account_data
|
154
149
|
end
|
155
150
|
|
156
151
|
def export(export_data)
|
@@ -380,12 +375,12 @@ module KPM
|
|
380
375
|
|
381
376
|
def fix_dates(value)
|
382
377
|
if !value.equal?(:DEFAULT)
|
383
|
-
|
378
|
+
|
384
379
|
dt = DateTime.parse(value)
|
385
380
|
return dt.strftime('%F %T').to_s
|
386
|
-
|
381
|
+
|
387
382
|
end
|
388
|
-
|
383
|
+
|
389
384
|
value
|
390
385
|
end
|
391
386
|
|
@@ -430,23 +425,23 @@ module KPM
|
|
430
425
|
end
|
431
426
|
|
432
427
|
def sniff_delimiter(file)
|
433
|
-
|
428
|
+
|
434
429
|
return nil if File.size?(file).nil?
|
435
|
-
|
430
|
+
|
436
431
|
first_line = File.open(file) {|f| f.readline}
|
437
|
-
|
432
|
+
|
438
433
|
return nil if first_line.nil?
|
439
|
-
|
434
|
+
|
440
435
|
sniff = {}
|
441
|
-
|
436
|
+
|
442
437
|
DELIMITERS.each do |delimiter|
|
443
438
|
sniff[delimiter] = first_line.count(delimiter)
|
444
439
|
end
|
445
|
-
|
440
|
+
|
446
441
|
sniff = sniff.sort {|a,b| b[1]<=>a[1]}
|
447
442
|
sniff.size > 0 ? sniff[0][0] : nil
|
448
443
|
end
|
449
|
-
|
444
|
+
|
450
445
|
# helper methods that set up killbill and database options: load_config_from_file; set_config; set_database_options;
|
451
446
|
# set_killbill_options;
|
452
447
|
def load_config_from_file(config_file)
|
@@ -46,7 +46,7 @@
|
|
46
46
|
:versions:
|
47
47
|
:0.14: 0.0.1
|
48
48
|
:0.16: 0.2.1
|
49
|
-
:0.18: 0.3.
|
49
|
+
:0.18: 0.3.1
|
50
50
|
:require:
|
51
51
|
- :merchant_id
|
52
52
|
- :public_key
|
@@ -113,7 +113,7 @@
|
|
113
113
|
:0.15: 0.0.2
|
114
114
|
:0.16: 0.0.5
|
115
115
|
:0.17: 1.0.0
|
116
|
-
:0.18: 1.1.
|
116
|
+
:0.18: 1.1.1
|
117
117
|
:litle:
|
118
118
|
:type: :ruby
|
119
119
|
:versions:
|
@@ -197,7 +197,7 @@
|
|
197
197
|
:0.15: 2.0.0
|
198
198
|
:0.16: 3.0.3
|
199
199
|
:0.17: 4.0.0
|
200
|
-
:0.18: 4.1.
|
200
|
+
:0.18: 4.1.1
|
201
201
|
:require:
|
202
202
|
- :api_secret_key
|
203
203
|
:zendesk:
|
@@ -205,7 +205,7 @@
|
|
205
205
|
:versions:
|
206
206
|
:0.14: 1.3.0
|
207
207
|
:0.16: 2.0.0
|
208
|
-
:0.18: 3.0.
|
208
|
+
:0.18: 3.0.1
|
209
209
|
:require:
|
210
210
|
- :subdomain
|
211
211
|
- :username
|
data/lib/kpm/tasks.rb
CHANGED
@@ -536,6 +536,58 @@ module KPM
|
|
536
536
|
end
|
537
537
|
end
|
538
538
|
end
|
539
|
+
|
540
|
+
method_option :key_prefix,
|
541
|
+
:type => :string,
|
542
|
+
:default => nil,
|
543
|
+
:enum => KPM::TenantConfig::KEY_PREFIXES,
|
544
|
+
:desc => 'Retrieve a per tenant key value based on key prefix'
|
545
|
+
method_option :killbill_api_credentials,
|
546
|
+
:type => :array,
|
547
|
+
:default => nil,
|
548
|
+
:desc => 'Killbill api credentials <api_key> <api_secrets>'
|
549
|
+
method_option :killbill_credentials,
|
550
|
+
:type => :array,
|
551
|
+
:default => nil,
|
552
|
+
:desc => 'Killbill credentials <user> <password>'
|
553
|
+
method_option :killbill_url,
|
554
|
+
:type => :string,
|
555
|
+
:default => nil,
|
556
|
+
:desc => 'Killbill URL ex. http://127.0.0.1:8080'
|
557
|
+
desc 'tenant_config', 'export all tenant-level configs.'
|
558
|
+
def tenant_config
|
559
|
+
logger.info 'Please wait processing the request!!!'
|
560
|
+
begin
|
561
|
+
|
562
|
+
if options[:killbill_url] && /https?:\/\/[\S]+/.match(options[:killbill_url]).nil?
|
563
|
+
raise Interrupt,'--killbill_url, required format -> http(s)://something'
|
564
|
+
end
|
565
|
+
|
566
|
+
if options[:killbill_api_credentials] && options[:killbill_api_credentials].size != 2
|
567
|
+
raise Interrupt,'--killbill_api_credentials, required format -> <api_key> <api_secrets>'
|
568
|
+
end
|
569
|
+
|
570
|
+
if options[:killbill_credentials] && options[:killbill_credentials].size != 2
|
571
|
+
raise Interrupt,'--killbill_credentials, required format -> <user> <password>'
|
572
|
+
end
|
573
|
+
|
574
|
+
if options[:key_prefix] === :key_prefix.to_s
|
575
|
+
raise Interrupt, "--key_prefix, posible values #{KPM::TenantConfig::KEY_PREFIXES.join(', ')}"
|
576
|
+
end
|
577
|
+
|
578
|
+
tenantConfig = KPM::TenantConfig.new(options[:killbill_api_credentials],options[:killbill_credentials],
|
579
|
+
options[:killbill_url], logger)
|
580
|
+
|
581
|
+
tenantConfig.export(options[:key_prefix])
|
582
|
+
|
583
|
+
rescue Exception => e
|
584
|
+
logger.error "\e[91;1m#{e.message}\e[0m"
|
585
|
+
if not e.is_a?(Interrupt)
|
586
|
+
logger.error e.backtrace.join("\n")
|
587
|
+
end
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
539
591
|
|
540
592
|
map :pull_ruby_plugin => :install_ruby_plugin,
|
541
593
|
:pull_java_plugin => :install_java_plugin
|
@@ -0,0 +1,131 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'json'
|
3
|
+
require 'killbill_client'
|
4
|
+
|
5
|
+
module KPM
|
6
|
+
|
7
|
+
class TenantConfig
|
8
|
+
# Killbill server
|
9
|
+
KILLBILL_HOST = ENV['KILLBILL_HOST'] || '127.0.0.1'
|
10
|
+
KILLBILL_URL = 'http://'.concat(KILLBILL_HOST).concat(':8080')
|
11
|
+
KILLBILL_API_VERSION = '1.0'
|
12
|
+
|
13
|
+
# USER/PWD
|
14
|
+
KILLBILL_USER = ENV['KILLBILL_USER'] || 'admin'
|
15
|
+
KILLBILL_PASSWORD = ENV['KILLBILL_PASSWORD'] || 'password'
|
16
|
+
|
17
|
+
# TENANT KEY
|
18
|
+
KILLBILL_API_KEY = ENV['KILLBILL_API_KEY'] || 'bob'
|
19
|
+
KILLBILL_API_SECRET = ENV['KILLBILL_API_SECRET'] || 'lazar'
|
20
|
+
|
21
|
+
# Temporary directory
|
22
|
+
TMP_DIR_PEFIX = 'killbill'
|
23
|
+
TMP_DIR = Dir.mktmpdir(TMP_DIR_PEFIX);
|
24
|
+
|
25
|
+
#Tenant key prefixes
|
26
|
+
KEY_PREFIXES = ['PLUGIN_CONFIG','PUSH_NOTIFICATION_CB','PER_TENANT_CONFIG',
|
27
|
+
'PLUGIN_PAYMENT_STATE_MACHINE','CATALOG','OVERDUE_CONFIG',
|
28
|
+
'INVOICE_TRANSLATION','CATALOG_TRANSLATION','INVOICE_TEMPLATE','INVOICE_MP_TEMPLATE']
|
29
|
+
|
30
|
+
|
31
|
+
def initialize(killbill_api_credentials = nil, killbill_credentials = nil, killbill_url = nil, logger = nil)
|
32
|
+
@killbill_api_key = KILLBILL_API_KEY
|
33
|
+
@killbill_api_secrets = KILLBILL_API_SECRET
|
34
|
+
@killbill_url = KILLBILL_URL
|
35
|
+
@killbill_user = KILLBILL_USER
|
36
|
+
@killbill_password = KILLBILL_PASSWORD
|
37
|
+
@logger = logger
|
38
|
+
|
39
|
+
set_killbill_options(killbill_api_credentials,killbill_credentials,killbill_url)
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def export(key_prefix = nil)
|
44
|
+
|
45
|
+
export_data = fetch_export_data(key_prefix)
|
46
|
+
|
47
|
+
if export_data.size == 0
|
48
|
+
raise Interrupt, 'key_prefix not found'
|
49
|
+
end
|
50
|
+
|
51
|
+
export_file = store_into_file(export_data)
|
52
|
+
|
53
|
+
if not File.exist?(export_file)
|
54
|
+
raise Interrupt, 'key_prefix not found'
|
55
|
+
else
|
56
|
+
@logger.info "\e[32mData exported under #{export_file}\e[0m"
|
57
|
+
end
|
58
|
+
|
59
|
+
export_file
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def fetch_export_data(key_prefix)
|
65
|
+
tenant_config = []
|
66
|
+
pefixes = key_prefix.nil? ? KEY_PREFIXES : [key_prefix]
|
67
|
+
|
68
|
+
pefixes.each do |prefix|
|
69
|
+
|
70
|
+
config_data = call_client(prefix)
|
71
|
+
|
72
|
+
if config_data.size > 0
|
73
|
+
config_data.each {|data| tenant_config << data }
|
74
|
+
@logger.info "Data for key prefix \e[1m#{prefix.to_s}\e[0m was \e[1mfound and is ready to be exported\e[0m."
|
75
|
+
else
|
76
|
+
@logger.info "Data for key prefix \e[1m#{prefix.to_s}\e[0m was \e[31mnot found\e[0m."
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
tenant_config
|
81
|
+
end
|
82
|
+
|
83
|
+
def call_client(key_prefix)
|
84
|
+
|
85
|
+
KillBillClient.url = @killbill_url
|
86
|
+
options = {
|
87
|
+
:username => @killbill_user,
|
88
|
+
:password => @killbill_password,
|
89
|
+
:api_key => @killbill_api_key,
|
90
|
+
:api_secret => @killbill_api_secrets
|
91
|
+
}
|
92
|
+
|
93
|
+
tenant_config_data = KillBillClient::Model::Tenant.search_tenant_config(key_prefix, options)
|
94
|
+
|
95
|
+
tenant_config_data
|
96
|
+
end
|
97
|
+
|
98
|
+
def store_into_file(export_data)
|
99
|
+
export_file = TMP_DIR + File::SEPARATOR + 'kbdump'
|
100
|
+
|
101
|
+
File.open(export_file, 'w') { |io| io.puts export_data.to_json }
|
102
|
+
|
103
|
+
export_file
|
104
|
+
end
|
105
|
+
|
106
|
+
def set_killbill_options(killbill_api_credentials, killbill_credentials, killbill_url)
|
107
|
+
|
108
|
+
if not killbill_api_credentials.nil?
|
109
|
+
|
110
|
+
@killbill_api_key = killbill_api_credentials[0]
|
111
|
+
@killbill_api_secrets = killbill_api_credentials[1]
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
if not killbill_credentials.nil?
|
116
|
+
|
117
|
+
@killbill_user = killbill_credentials[0]
|
118
|
+
@killbill_password = killbill_credentials[1]
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
if not killbill_url.nil?
|
123
|
+
|
124
|
+
@killbill_url = killbill_url
|
125
|
+
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
data/lib/kpm/version.rb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe KPM::TenantConfig do
|
4
|
+
include_context 'connection_setup'
|
5
|
+
|
6
|
+
let(:value) {"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<catalog>\n <effectiveDate>2017-04-25T15:57:43Z</effectiveDate>\n <catalogName>DEFAULT</catalogName>\n <recurringBillingMode>IN_ADVANCE</recurringBillingMode>\n <currencies/>\n <units/>\n <products/>\n <rules>\n <changePolicy>\n <changePolicyCase>\n <policy>IMMEDIATE</policy>\n </changePolicyCase>\n </changePolicy>\n <changeAlignment>\n <changeAlignmentCase>\n <alignment>START_OF_BUNDLE</alignment>\n </changeAlignmentCase>\n </changeAlignment>\n <cancelPolicy>\n <cancelPolicyCase>\n <policy>IMMEDIATE</policy>\n </cancelPolicyCase>\n </cancelPolicy>\n <createAlignment>\n <createAlignmentCase>\n <alignment>START_OF_BUNDLE</alignment>\n </createAlignmentCase>\n </createAlignment>\n <billingAlignment>\n <billingAlignmentCase>\n <alignment>ACCOUNT</alignment>\n </billingAlignmentCase>\n </billingAlignment>\n <priceList>\n <priceListCase>\n <toPriceList>DEFAULT</toPriceList>\n </priceListCase>\n </priceList>\n </rules>\n <plans/>\n <priceLists>\n <defaultPriceList name=\"DEFAULT\">\n <plans/>\n </defaultPriceList>\n </priceLists>\n</catalog>\n"}
|
7
|
+
let(:key) {'CATALOG_RSPEC'}
|
8
|
+
|
9
|
+
let(:user) {'KPM Tenant Spec'}
|
10
|
+
let(:tenant_config_class) { described_class.new([killbill_api_key,killbill_api_secrets],
|
11
|
+
[killbill_user, killbill_password],url,logger)}
|
12
|
+
let(:options){{
|
13
|
+
:username => killbill_user,
|
14
|
+
:password => killbill_password,
|
15
|
+
:api_key => killbill_api_key,
|
16
|
+
:api_secret => killbill_api_secrets
|
17
|
+
}}
|
18
|
+
|
19
|
+
describe '#initialize' do
|
20
|
+
context 'when creating an instance of tenant config class' do
|
21
|
+
|
22
|
+
it 'when initialized with defaults' do
|
23
|
+
expect(described_class.new).to be_an_instance_of(KPM::TenantConfig)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'when initialized with options' do
|
27
|
+
tenant_config_class.should be_an_instance_of(KPM::TenantConfig)
|
28
|
+
expect(tenant_config_class.instance_variable_get(:@killbill_api_key)).to eq(killbill_api_key)
|
29
|
+
expect(tenant_config_class.instance_variable_get(:@killbill_api_secrets)).to eq(killbill_api_secrets)
|
30
|
+
expect(tenant_config_class.instance_variable_get(:@killbill_user)).to eq(killbill_user)
|
31
|
+
expect(tenant_config_class.instance_variable_get(:@killbill_password)).to eq(killbill_password)
|
32
|
+
expect(tenant_config_class.instance_variable_get(:@killbill_url)).to eq(url)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#export' do
|
41
|
+
it 'when retrieving tenant configuration' do
|
42
|
+
KillBillClient.url = url
|
43
|
+
|
44
|
+
#Add a new tenant config
|
45
|
+
tenant_config = KillBillClient::Model::Tenant.upload_tenant_user_key_value(key, value, user, nil, nil, options)
|
46
|
+
expect(tenant_config.key).to eq(key)
|
47
|
+
|
48
|
+
#get created tenant config
|
49
|
+
export_file = tenant_config_class.export(key)
|
50
|
+
expect(File.exist?(export_file)).to be_true
|
51
|
+
expect(File.readlines(export_file).grep(/#{key}/)).to be_true
|
52
|
+
|
53
|
+
#remove created tenant config
|
54
|
+
KillBillClient::Model::Tenant.delete_tenant_user_key_value(key, user, nil, nil, options)
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -3,19 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe KPM::Account do
|
4
4
|
|
5
5
|
shared_context 'account' do
|
6
|
-
|
7
|
-
|
8
|
-
logger}
|
9
|
-
let(:yml_file) {YAML::load_file(Dir["#{Dir.pwd}/**/account_spec.yml"][0])}
|
10
|
-
let(:dummy_data_file) {Dir.mktmpdir('dummy') + File::SEPARATOR + 'kbdump'}
|
11
|
-
let(:url) {"http://#{yml_file['killbill']['host']}:#{yml_file['killbill']['port']}"}
|
12
|
-
let(:killbill_api_key) {yml_file['killbill']['api_key']}
|
13
|
-
let(:killbill_api_secrets) {yml_file['killbill']['api_secret']}
|
14
|
-
let(:killbill_user) {yml_file['killbill']['user']}
|
15
|
-
let(:killbill_password) {yml_file['killbill']['password']}
|
16
|
-
let(:db_name) {yml_file['database']['name']}
|
17
|
-
let(:db_username) {yml_file['database']['user']}
|
18
|
-
let(:db_password) {yml_file['database']['password']}
|
6
|
+
include_context 'connection_setup'
|
7
|
+
|
19
8
|
let(:account_class) { described_class.new(nil,[killbill_api_key,killbill_api_secrets],
|
20
9
|
[killbill_user, killbill_password],url,
|
21
10
|
db_name, [db_username, db_password],nil,logger)}
|
@@ -51,6 +40,7 @@ describe KPM::Account do
|
|
51
40
|
expect(account_class.instance_variable_get(:@killbill_user)).to eq(killbill_user)
|
52
41
|
expect(account_class.instance_variable_get(:@killbill_password)).to eq(killbill_password)
|
53
42
|
expect(account_class.instance_variable_get(:@killbill_url)).to eq(url)
|
43
|
+
|
54
44
|
end
|
55
45
|
|
56
46
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -12,3 +12,21 @@ RSpec.configure do |config|
|
|
12
12
|
config.tty = true
|
13
13
|
config.formatter = 'documentation'
|
14
14
|
end
|
15
|
+
|
16
|
+
shared_context 'connection_setup' do
|
17
|
+
let(:logger) do
|
18
|
+
logger = ::Logger.new(STDOUT)
|
19
|
+
logger.level = Logger::FATAL
|
20
|
+
logger
|
21
|
+
end
|
22
|
+
let(:yml_file) {YAML::load_file(Dir["#{Dir.pwd}/**/account_spec.yml"][0])}
|
23
|
+
let(:dummy_data_file) {Dir.mktmpdir('dummy') + File::SEPARATOR + 'kbdump'}
|
24
|
+
let(:url) {"http://#{yml_file['killbill']['host']}:#{yml_file['killbill']['port']}"}
|
25
|
+
let(:killbill_api_key) {yml_file['killbill']['api_key']}
|
26
|
+
let(:killbill_api_secrets) {yml_file['killbill']['api_secret']}
|
27
|
+
let(:killbill_user) {yml_file['killbill']['user']}
|
28
|
+
let(:killbill_password) {yml_file['killbill']['password']}
|
29
|
+
let(:db_name) {yml_file['database']['name']}
|
30
|
+
let(:db_username) {yml_file['database']['user']}
|
31
|
+
let(:db_password) {yml_file['database']['password']}
|
32
|
+
end
|
metadata
CHANGED
@@ -1,73 +1,86 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: highline
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: 1.6.21
|
20
|
-
|
19
|
+
name: highline
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.6.21
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: nexus_cli
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: 4.1.0
|
34
|
-
|
33
|
+
name: nexus_cli
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 4.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: thor
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: 0.19.1
|
48
|
-
|
47
|
+
name: thor
|
49
48
|
prerelease: false
|
49
|
+
type: :runtime
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.19.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubyzip
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - "~>"
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 1.2.0
|
62
|
-
|
61
|
+
name: rubyzip
|
63
62
|
prerelease: false
|
63
|
+
type: :runtime
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.2.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.0'
|
75
|
+
name: killbill-client
|
76
|
+
prerelease: false
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
71
84
|
requirement: !ruby/object:Gem::Requirement
|
72
85
|
requirements:
|
73
86
|
- - ">="
|
@@ -76,8 +89,9 @@ dependencies:
|
|
76
89
|
- - "<"
|
77
90
|
- !ruby/object:Gem::Version
|
78
91
|
version: 11.0.0
|
79
|
-
|
92
|
+
name: rake
|
80
93
|
prerelease: false
|
94
|
+
type: :development
|
81
95
|
version_requirements: !ruby/object:Gem::Requirement
|
82
96
|
requirements:
|
83
97
|
- - ">="
|
@@ -87,33 +101,19 @@ dependencies:
|
|
87
101
|
- !ruby/object:Gem::Version
|
88
102
|
version: 11.0.0
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
|
-
name: rspec
|
91
104
|
requirement: !ruby/object:Gem::Requirement
|
92
105
|
requirements:
|
93
106
|
- - "~>"
|
94
107
|
- !ruby/object:Gem::Version
|
95
108
|
version: 2.12.0
|
96
|
-
|
109
|
+
name: rspec
|
97
110
|
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 2.12.0
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: killbill-client
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '1.0'
|
110
111
|
type: :development
|
111
|
-
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
116
|
+
version: 2.12.0
|
117
117
|
description: A package manager for Kill Bill.
|
118
118
|
email: killbilling-users@googlegroups.com
|
119
119
|
executables:
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- lib/kpm/sha1_checker.rb
|
150
150
|
- lib/kpm/system.rb
|
151
151
|
- lib/kpm/tasks.rb
|
152
|
+
- lib/kpm/tenant_config.rb
|
152
153
|
- lib/kpm/tomcat_manager.rb
|
153
154
|
- lib/kpm/uninstaller.rb
|
154
155
|
- lib/kpm/utils.rb
|
@@ -160,6 +161,8 @@ files:
|
|
160
161
|
- spec/kpm/remote/killbill_plugin_artifact_spec.rb
|
161
162
|
- spec/kpm/remote/killbill_server_artifact_spec.rb
|
162
163
|
- spec/kpm/remote/migrations_spec.rb
|
164
|
+
- spec/kpm/remote/tenant_config_spec.rb
|
165
|
+
- spec/kpm/remote/tenant_config_spec.yml
|
163
166
|
- spec/kpm/remote/tomcat_manager_spec.rb
|
164
167
|
- spec/kpm/unit/base_artifact_spec.rb
|
165
168
|
- spec/kpm/unit/inspector_spec.rb
|
@@ -177,7 +180,7 @@ homepage: http://kill-bill.org
|
|
177
180
|
licenses:
|
178
181
|
- Apache License (2.0)
|
179
182
|
metadata: {}
|
180
|
-
post_install_message:
|
183
|
+
post_install_message:
|
181
184
|
rdoc_options:
|
182
185
|
- "--exclude"
|
183
186
|
- "."
|
@@ -194,29 +197,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
197
|
- !ruby/object:Gem::Version
|
195
198
|
version: '0'
|
196
199
|
requirements: []
|
197
|
-
rubyforge_project:
|
198
|
-
rubygems_version: 2.
|
199
|
-
signing_key:
|
200
|
+
rubyforge_project:
|
201
|
+
rubygems_version: 2.4.8
|
202
|
+
signing_key:
|
200
203
|
specification_version: 4
|
201
204
|
summary: Kill Bill package manager.
|
202
|
-
test_files:
|
203
|
-
- spec/kpm/remote/base_artifact_spec.rb
|
204
|
-
- spec/kpm/remote/base_installer_spec.rb
|
205
|
-
- spec/kpm/remote/installer_spec.rb
|
206
|
-
- spec/kpm/remote/kaui_artifact_spec.rb
|
207
|
-
- spec/kpm/remote/killbill_plugin_artifact_spec.rb
|
208
|
-
- spec/kpm/remote/killbill_server_artifact_spec.rb
|
209
|
-
- spec/kpm/remote/migrations_spec.rb
|
210
|
-
- spec/kpm/remote/tomcat_manager_spec.rb
|
211
|
-
- spec/kpm/unit/base_artifact_spec.rb
|
212
|
-
- spec/kpm/unit/inspector_spec.rb
|
213
|
-
- spec/kpm/unit/installer_spec.rb
|
214
|
-
- spec/kpm/unit/plugins_directory_spec.rb
|
215
|
-
- spec/kpm/unit/plugins_manager_spec.rb
|
216
|
-
- spec/kpm/unit/sha1_checker_spec.rb
|
217
|
-
- spec/kpm/unit/sha1_test.yml
|
218
|
-
- spec/kpm/unit/uninstaller_spec.rb
|
219
|
-
- spec/kpm/unit_mysql/account_spec.rb
|
220
|
-
- spec/kpm/unit_mysql/account_spec.yml
|
221
|
-
- spec/kpm/unit_mysql/account_test_ddl.sql
|
222
|
-
- spec/spec_helper.rb
|
205
|
+
test_files: []
|