view bin/run_test @ 492:3038dddd33cb

Adjust build script (matches rails default)
author nanaya <me@nanaya.net>
date Tue, 17 Jan 2023 02:50:24 +0900
parents d31fe32da7a0
children
line wrap: on
line source

#!/bin/sh

set -x

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
\$cfg[:standalone] = true
\$cfg[:secret_key] = "$(bundle exec rake secret)"
EOF
fi

RAILS_ENV=test bundle exec rake db:setup
bundle exec rake