/
ci
executable file
·36 lines (29 loc) · 1.21 KB
/
ci
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Continuous Integration build script.
echo '========== Set Up RVM ==============================================='
export PATH=$PATH:~/.rvm/bin
source ~/.rvm/scripts/rvm
set -e # Exit on any error
cd . # Kick off the rvmrc
set -x # Echo each command
echo '========== Verify Environment ======================================='
ruby -v
gem env gemdir
env | sort
echo '========== Install Gems ============================================='
bundle --no-color --local install
echo '========== Run Specs ================================================'
# Set display for selenium
export DISPLAY=:42.0
# Set rspec output options
export SPEC_OPTS="-f s"
rake db:create:all db:migrate spec
echo '========== Deploy To Staging ========================================'
# Determine what revision we're testing.
revision=`git show --format=oneline | head -1 | cut -d ' ' -f 1`
# Deploy to staging.
cap staging deploy -s branch=$revision
echo '========== Verify Content ==========================================='
# Ensure that some key pages display properly.
curl http://lifeviz.staging.westarete.com/ | grep -3 "Biodiversity Heritage Library"
curl http://lifeviz.staging.westarete.com/class/Mammalia | grep -3 "Rodentia"