Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 50 lines (39 sloc) 1.067 kB
d3b663a @xaviershay script/ci for Jenkins.
xaviershay authored
1 #!/usr/bin/env bash
2
3 bundler_version="1.0.18"
4
5 source "$HOME/.rvm/scripts/rvm"
6
7 function install_ruby_if_needed() {
8 echo "Checking for $1..."
9 if ! rvm list rubies | grep $1 > /dev/null; then
10 echo "Ruby not found $1..."
11 rvm install $1
12 fi
13 }
14
15 function switch_ruby() {
16 install_ruby_if_needed $1 && rvm use $1
17 }
18
19 function install_bundler_if_needed() {
20 echo "Checking for Bundler $bundler_version..."
21 if ! gem list --installed bundler --version "$bundler_version" > /dev/null; then
22 gem install bundler --version "$bundler_version" --source http://mirrors.squareup.com/rubygems
23 fi
24 }
25
26 function update_gems_if_needed() {
27 echo "Installing gems..."
28 bundle check || bundle install
29 }
30
31 function run_tests() {
32 bundle exec rake
33 }
34
35 function prepare_and_run() {
36 switch_ruby $1 &&
37 install_bundler_if_needed &&
38 update_gems_if_needed &&
39 run_tests
40 }
41
42 function tag_green_build() {
43 tag_name="ci-cane-master/latest"
44 git tag -f -m "tagging green build" "$tag_name"
45 git push -f origin "$tag_name"
46 }
47
48 prepare_and_run "1.9.3-p0" &&
49 tag_green_build
Something went wrong with that request. Please try again.