annotate bin/run_test @ 472:b26dd8fa1c26 bootstrap-4

Update link to source
author nanaya <me@nanaya.pro>
date Sun, 23 Feb 2020 22:42:15 +0900
parents d31fe32da7a0
children
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
301
2fb00d365745 Add set -x to view commands executed for test.
edogawaconan <me@myconan.net>
parents: 300
diff changeset
3 set -x
2fb00d365745 Add set -x to view commands executed for test.
edogawaconan <me@myconan.net>
parents: 300
diff changeset
4
300
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
5 test true = "$CI" && bi_params="--without development"
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 bundle install $bi_params
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
7
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
8 if ! test -f config/database.yml; then
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
9 cat << EOF > config/database.yml
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 test:
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
11 adapter: postgresql
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
12 database: zp_test
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 user: postgres
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
14 EOF
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
15 fi
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
16
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
17 if ! test -f config/local_config.rb; then
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 # rake requires booting Rails which in turn requires availability of
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
19 # local_config.
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
20 touch config/local_config.rb
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
21 cat << EOF > config/local_config.rb
437
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 305
diff changeset
22 \$cfg[:standalone] = true
d31fe32da7a0 Finish updating to rails 5
nanaya <me@myconan.net>
parents: 305
diff changeset
23 \$cfg[:secret_key] = "$(bundle exec rake secret)"
300
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
24 EOF
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
25 fi
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
26
305
4f7fb63f0537 db:setup for test.
edogawaconan <me@myconan.net>
parents: 301
diff changeset
27 RAILS_ENV=test bundle exec rake db:setup
300
f84df8a294e6 Put build script to bin/.
edogawaconan <me@myconan.net>
parents:
diff changeset
28 bundle exec rake