From d9e5eaaeebe0a7407ee8cdfbb2100202de330c6d Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Wed, 11 Jun 2014 21:10:15 -0400 Subject: [PATCH] Update README [skip ci] API now requires that `logs` table should be set up properly --- README.md | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5c82ce7c..d52ce9d1 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,48 @@ This is the app running on https://api.travis-ci.org/ +## Requirements + +1. PostgreSQL 9.3 or higher +1. Redis +1. RabbitMQ + ## Installation -Setup: +### Setup $ bundle install -Run tests: +### Database setup + +1. `rake db:create db:structure:load` +1. Clone `travis-logs` and copy the `logs` database (assume the PostgreSQL user is `postgres`): +```sh-session +cd .. +git clone https://github.com/travis-ci/travis-logs.git +cd travis-logs +rvm jruby do bundle exec rake db:migrate # `travis-logs` requires JRuby +psql -c "DROP TABLE IF EXISTS logs CASCADE" -U postgres travis_development +pg_dump -t logs travis_logs_development | psql -U postgres travis_development +``` + +Repeat the database steps for `RAILS_ENV=test`. +```sh-session +RAILS_ENV=test rake db:create db:structure:load +pushd ../travis-logs +RAILS_ENV=test rvm jruby do bundle exec rake db:migrate +psql -c "DROP TABLE IF EXISTS logs CASCADE" -U postgres travis_test +pg_dump -t logs travis_logs_test | psql -U postgres travis_test +popd +``` + + +### Run tests - $ RAILS_ENV=test rake db:create db:structure:load $ rake spec -Run the server: +### Run the server - $ rake db:create db:structure:load $ script/server ## Contributing