view bin/run_test @ 300:f84df8a294e6

Put build script to bin/.
author edogawaconan <me@myconan.net>
date Wed, 12 Feb 2014 15:42:57 +0900
parents
children 2fb00d365745
line wrap: on
line source

#!/bin/sh

test true = "$CI" && bi_params="--without development"
bundle install $bi_params

if ! test -f config/database.yml; then
  cat << EOF > config/database.yml
test:
  adapter: postgresql
  database: zp_test
  user: postgres
EOF
fi

if ! test -f config/local_config.rb; then
  # rake requires booting Rails which in turn requires availability of
  # local_config.
  touch config/local_config.rb
  cat << EOF > config/local_config.rb
CONFIG["standalone"] = true
CONFIG["secret_key"] = "$(bundle exec rake secret)"
EOF
fi

bundle exec rake