annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
300
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 #!/bin/sh
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
2
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
3 test true = "$CI" && bi_params="--without development"
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
4 bundle install $bi_params
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 if ! test -f config/database.yml; then
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
7 cat << EOF > config/database.yml
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
8 test:
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 adapter: postgresql
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 database: zp_test
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
11 user: postgres
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
12 EOF
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 fi
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
14
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
15 if ! test -f config/local_config.rb; then
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
16 # rake requires booting Rails which in turn requires availability of
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
17 # local_config.
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 touch config/local_config.rb
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
19 cat << EOF > config/local_config.rb
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
20 CONFIG["standalone"] = true
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
21 CONFIG["secret_key"] = "$(bundle exec rake secret)"
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
22 EOF
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
23 fi
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
24
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
25 bundle exec rake