Simplify env setup (#462)

* Simplify environment setup

* Fix TravsCI config

* Fix typo
This commit is contained in:
Helge Rausch
2017-12-28 18:54:33 +01:00
committed by Bastian Greshake Tzovaras
parent c255e75b6d
commit f2740aba52
5 changed files with 20 additions and 10 deletions

View File

@@ -6,11 +6,8 @@
# or not.
export SECRET_KEY_BASE=foo
export SECRET_TOKEN=bar
export RAILS_ENV=development
export POSTGRES_URL="postgres://localhost/snpr_$RAILS_ENV"
export REDIS_URL=redis://localhost
export FITBIT_CONSUMER_KEY=foo
export FITBIT_CONSUMER_SECRET=bar
export PLOS_API_KEY=foo
export RECAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
export RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI

12
.env.test Normal file
View File

@@ -0,0 +1,12 @@
export PATH="./bin:$PATH"
export BASE_URL=http://localhost
export SECRET_KEY_BASE=foo
export SECRET_TOKEN=bar
export POSTGRES_URL="postgres://localhost/snpr_$RAILS_ENV"
export PLOS_API_KEY=foo
export RECAPTCHA_SECRET_KEY=foo
export RECAPTCHA_SITE_KEY=bar
export MENDELEY_CONSUMER_KEY=foo
export ERRBIT_API_KEY=foo
export ERRBIT_HOST=localhost
export OH_CLIENT_ID=foo

2
.gitignore vendored
View File

@@ -31,5 +31,5 @@ tmp/pids/server.pid
vendor/bundle
vendor/cache
logfile
.env
.env*.local
.DS_Store

View File

@@ -14,7 +14,6 @@ env: DB=postgres CI=1
bundler_args: --without development debug
before_script:
- cp config/database.yml.ci config/database.yml
- cp .env.example .env
- bundle exec rake db:setup
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > bin/cc-test-reporter
- chmod +x bin/cc-test-reporter

View File

@@ -70,11 +70,13 @@ bundle install
## Setup config
All configuration is done via environment variables. A file with a
working environment for development can be found at `.env.example`.
Simply copy it to `.env` to use it as is. The
[dotenv](https://github.com/bkeepers/dotenv) gem will pick it up
and set the environment variables.
All configuration is done via environment variables. Files for setting up
working environments for testing and development are included (i.e. `.env.test`
and `.env.development`). The [dotenv](https://github.com/bkeepers/dotenv) gem
will pick them up and set the environment variables. If you need to override
variables locally, click
[here](https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use) for
instructions.
Copy `config/database.yml.example` to `config/database.yml` and adapt to your
database setup. Specially, pay attention to the database username and password