-
Notifications
You must be signed in to change notification settings - Fork 1
/
ci-exec.sh
executable file
·56 lines (44 loc) · 1021 Bytes
/
ci-exec.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash -xe
if [ -z $RAILS_ENV ]; then
export RAILS_ENV=ci
fi
if [ -z $GEMSET ]; then
GEMSET=ncs_navigator_core
fi
if [ -z $CI_RUBY ]; then
echo "CI_RUBY must be set"
exit 1
fi
# Feel free to bump this as new versions of bundler that work with this CI
# script are released.
export BUNDLER_VERSION=1.3.5
set +xe
echo "Initializing RVM"
source ~/.rvm/scripts/rvm
set -xe
# On the overnight build, reinstall all gems
if [ `date +%H` -lt 5 ]; then
set +xe
echo "Purging gemset to verify that all deps can still be installed"
rvm --force $CI_RUBY gemset delete $GEMSET
set -xe
fi
RVM_CONFIG="${CI_RUBY}@${GEMSET}"
set +xe
echo "Switching to ${RVM_CONFIG}"
rvm use $RVM_CONFIG
set -xe
which ruby
ruby -v
set +e
gem list -i bundler -v $BUNDLER_VERSION
if [ $? -ne 0 ]; then
set -e
gem install bundler -v $BUNDLER_VERSION
fi
set -e
bundle _${BUNDLER_VERSION}_ install
if [ -z $CI_TASKS ]; then
CI_TASKS='ci:core'
fi
bundle _${BUNDLER_VERSION}_ exec rake $CI_TASKS --trace