sparkle-pack-rails-helpers

Generate DATABASE_URL and such


License
MIT
Install
gem install sparkle-pack-rails-helpers -v 0.1.0

Documentation

sparkle-pack-shell-helpers

This is SparklePack to abstract some configuration tweaks you'd need while deploying Rails app.

It is in experimental state, use at your own risk.

Usage

Add the pack to your Gemfile and .sfn:

Gemfile:

source 'https://rubygems.org'

gem 'sfn'
gem 'sparkle-pack-rails-helpers'

.sfn:

Configuration.new do
  sparkle_pack [ 'sparkle-pack-rails-helpers' ]
  ...
end

In a SparkleFormation template use as needed:

user_data registry!(:rails_database_url,
             adapter: 'mysql2',
             host: ref!(:db_address),
             port: 3306,
             database: ref!(:db_name),
             username: 'foo',
             password: 'bar')

This produces the following UserData:

{ "Fn::Join": [
  "",
  [
    "mysql2", "://", "foo", ":", "bar",
    {
      "Ref": "DbAddress"
    },
    ":", "3306", "/",
    {
      "Ref": "DbName"
    }
  ]
]}

Contributions

Pull requests and bug reports are welcome.

License and authors