GithubHelp home page GithubHelp logo

isabella232 / step-rails-database-yml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from closer/step-rails-database-yml

0.0 0.0 0.0 20 KB

Generates a config/database.yml file with the environment information from your database service.

Shell 100.00%

step-rails-database-yml's Introduction

Rails database yml

Generates a config/database.yml file with the environment information from your database service.

For this step you need to have a mysql or postgres. See the services on wercker devcenter for more information about services.

What's new

  • Add support for the ewok stack.

Options

  • service This option is not required. If set, it will load the template from the specified service; otherwise, it will infer the service from the environment.
  • postgresql-min-message (optinal, default: warning): Set the min_messages parameter in the postgresql template.

Supported services

Currently wercker/postgresql and wercker/mysql for the old stack are supported. No further configuration is required for these services.

The following docker containers are supported in the new stack: postgres and mysql. Both have some required and recommended environment variables.

The postgresql container requires the POSTGRES_PASSWORD environment variable to be set. The other environment variables are POSTGRES_USER and POSTGRES_DB. All environment variables are used in this step, or use the same defaults as the container.

The mysql container requires the MYSQL_ROOT_PASSWORD, but this password won't be used by this step. Make sure you also set MYSQL_DATABASE, MYSQL_USER and MYSQL_PASSWORD. These are the environment variables that will be used by this step.

Example

The following wercker.yml:

box: wercker/ruby
services:
  - wercker/postgresql
build:
  steps:
    - rails-database-yml

Will generate the following config/database.yml:

test:
    adapter: postgresql
    encoding: "utf8"
    database: <%= ENV['WERCKER_POSTGRESQL_DATABASE'] %><%= ENV['TEST_ENV_NUMBER'] %>
    username: <%= ENV['WERCKER_POSTGRESQL_USERNAME'] %>
    password: <%= ENV['WERCKER_POSTGRESQL_PASSWORD'] %>
    host: <%= ENV['WERCKER_POSTGRESQL_HOST'] %>
    port: <%= ENV['WERCKER_POSTGRESQL_PORT'] %>
    min_messages: warning

Changelog

1.1.0

  • Add support for the ewok stack.

1.0.0

  • Add postgresql-min-message parameter

0.9.3

  • Use $PWD instead of $WERCKER_ROOT_DIR

0.9.2

  • Adds environment variable TEST_ENV_NUMBER to the database name

0.9.1

  • Initial version

step-rails-database-yml's People

Contributors

cybernetlab avatar gilbode avatar hatchan avatar luvtechno avatar pjvds avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.