#!/bin/sh

set -e

gem update bundler
cp -r config/examples/* config/
bundle config geminabox.3sca.net threeSc4rep0:Asfgiuyi61237rgo79fik11
bundle check || bundle install

bundle exec rake db:create:all
bundle exec rake db:test:load

gem install zeus

[ ! -f ${HOME}/.s3cfg ] \
 && echo "go read https://github.com/3scale/system/wiki/Amazon-s3-and-s3cmd and set up s3cmd" \
 && exit 1

bundle exec rake db:import

bundle exec script/3scale unlock
