forked from NUBIC/surveyor
-
Notifications
You must be signed in to change notification settings - Fork 3
/
stacktests.sh
executable file
·65 lines (60 loc) · 1.61 KB
/
stacktests.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
57
58
59
60
61
62
63
64
65
#!/bin/bash
echo ""
# Set the prompt for the select command
PS3="Choose a stack or 'q' to quit: "
export CUCUMBER_OPTS="--format CucumberSpinner::ProgressBarFormatter"
export SPEC_OPTS="--format Fuubar --color spec"
export BUNDLER_VERSION=1.3.1
options=""
rubies=(1.9.3)
rails_versions=(rails_3.1 rails_3.2)
for i in "${rubies[@]}"
do
for j in "${rails_versions[@]}"
do
options+="$i@$j "
done
done
options+="all"
# Show a menu and ask for input.
select combo in $options; do
case $combo in
all)
for i in "${rubies[@]}"
do
for j in "${rails_versions[@]}"
do
export CI_RUBY=$i
export RAILS_VERSION=$j
source ~/.rvm/scripts/rvm
rvm use $CI_RUBY@surveyor-$RAILS_VERSION --create
read -p "Press [Enter] to run tests on $CI_RUBY@$RAILS_VERSION..."
gem list -i bundler -v $BUNDLER_VERSION
if [ $? -ne 0 ]; then
gem install bundler -v $BUNDLER_VERSION
fi
bundle _${BUNDLER_VERSION}_ update
bundle _${BUNDLER_VERSION}_ exec rake testbed spec cucumber cucumber:wip
done
done
;;
"")
echo ""
;;
*)
arr=(${combo//@/ })
export CI_RUBY=${arr[0]}
export RAILS_VERSION=${arr[1]}
source ~/.rvm/scripts/rvm
rvm use $CI_RUBY@surveyor-$RAILS_VERSION --create
read -p "Press [Enter] to run tests on $CI_RUBY@$RAILS_VERSION..."
gem list -i bundler -v $BUNDLER_VERSION
if [ $? -ne 0 ]; then
gem install bundler -v $BUNDLER_VERSION
fi
bundle _${BUNDLER_VERSION}_ update
bundle _${BUNDLER_VERSION}_ exec rake testbed spec cucumber cucumber:wip
;;
esac
break
done