Handle not ready repos
[gitorious.git] / ci / build
blob0739a183a1ef6664ff8fc490132f9d9dd748649e
1 #!/bin/bash
3 # This script is intended to only run inside Jenkins.
4 # https://ci.gitorious.org/jenkins/
6 cp config/gitorious.sample.yml config/gitorious.yml
7 cp config/database.sample.yml config/database.yml
8 sed -i 's/username:.*/username: gitorious/' config/database.yml
9 sed -i 's/password:.*/password: gitorious/' config/database.yml
10 # Optionally use a slave-specific database.
11 if [[ -n "$DATABASE" ]]; then
12 sed -i "s/database:.*/database: $DATABASE/" config/database.yml
15 export GEM_HOME=$HOME/.gems
16 export RAILS_ENV=test
17 export PATH=$HOME/.gems/bin:$PATH
19 # Fix for Red Hat's old bundler package. When Red Hat updates to bundler 1.3,
20 # this can go away.
21 sed -i 's/:ruby_20//' Gemfile
23 # Fix for https://groups.google.com/d/topic/gitorious/XG_WAWIZ8aA/discussion
24 mkdir -p tmp/cache
26 SCL=${SCL-bash}
27 $SCL - <<EOF
28 set -x
29 bundle install
30 bundle exec rake db:test:purge
31 bundle exec rake db:setup
32 COVERAGE=1 bundle exec "rake -f ci/stub.rake ci:setup:minitest test:units rcov"
33 EOF