auto-configuration detection by default #37
Comments
Some background about configuration:
About this ticket:
|
ah - cool, missed the "sane defaults" - before changing the ticket's concerns I'd like to understand some:
not sure what do you mean by "unfortunately" :) ... you need a place to configure GW credentials or ?
OK, thus this can probably go into a separate feature request. also I'm not sure what it should be if you'd like me to do it (seems that exporting the server configuration as back to database configuration - related to tests. :stripe:
:api_secret_key: <%= ENV['API_SECRET_KEY'] %>
:api_publishable_key: <%= ENV['API_PUBLISHABLE_KEY'] %>
:test: true
<% if ENV['KILLBILL_ENV'] == 'test' %>
:database:
:adapter: <%= ENV['AR_ADAPTER'] || 'mariadb' %>
:username: <%= ENV['AR_USERNAME'] || 'killbill' %>
:database: <%= ENV['AR_DATABASE'] || 'killbill' %>
:pool: 30 # AR's default is max 5 connections
<% end %>
|
In multi-tenant mode, the latest version of Kill Bill lets you store this YAML file in the database (see the curl example in the Stripe README for instance). At runtime, we retrieve these per-tenant credentials from Kill Bill, using the tenant id.
👍
The I'm actually not sure either what the best way to auto-detect Kill Bill would be. Does JRuby know it is running in a
That sounds good (and the sane defaults would be picked up instead when run inside Kill Bill).
I've actually been learning from the refactoring you did in the specs about some of possibilities with RSpec (I'm still at RSpec 101 😄). Wouldn't it be possible to do something similar and have the plugin tests inherit from a shared
Actually, that what my main roadblock when I had looked at it a while back. Are all the options passed to |
najs!
right, makes sense - thanks for clarifying
knowing that we're on
yy, unless of course the user explicitly configured something for KB to use ... (e.g. wants to use pool: 20)
yes, except when you use |
looking at commits reminded me that I wanted the plugin's .yml to go through erb (just like in Rails)
@pierre added it already 336b0aa ... so I was thinking about getting it to the 'next' level - generating a default yaml file that auto-detects whether it is running inside KB :
currently on kares-performance branch I'm actually able to use something like :
... what this lucks is a simple way of detecting KB - e.g.
defined? KILLBILL_SERVER_VERSION
or exporting theKillbillServerConfig
in a global constant ~defined? KILLBILL_CONFIG
(such a constant could be set before plugins are started) from JRubyPlugin. or one could simply useENV
I'm really not sure about what the "officlal" (best-approach) for the next KB could be ...p.s. just so I do not forget - tuning erb to work with
<%-
could be useful as well ...The text was updated successfully, but these errors were encountered: