Change soft-fail to use the config, rather than env
[rbx.git] / tools / rubuildius / bin / rubinius.zsh
blob5f8eafd47e50d859be6bd28871dd57b8fbb5ab68
1 #!/bin/zsh
3 trap '' HUP
4 trap '' ABRT
6 [[ -z $1 ]] && exit
7 unset RUBYOPT # so that rubinius builds
9 root=~/continuous
10 #pastie=$root/bin/pastie.rb
11 pastie=$root/bin/nopaste
12 rubinius=$root/repo/rubinius
13 head=$rubinius/HEAD
14 thischeckout=$rubinius/$1
16 cd $head
17 git pull &>/dev/null
19 rm -rf $thischeckout &>/dev/null
20 git clone $head $thischeckout &>/dev/null
21 cd $thischeckout
22 git checkout $1 2>/dev/null
25 rake build &>build_log
26 # did it build?
27 if [[ $? -ne 0 ]]; then
28 echo "build failed! `cat build_log | $pastie`"
29 exit 1
32 # version and stuff
33 ./shotgun/rubinius -v -e 'true' &>ci_log
34 # a bit of a workaround because ci_log can exec
35 ./bin/ci -f m &>>ci_log
37 #sleep 5
38 #old=$(stat -c '%Y' ci_log)
39 #sleep 10
41 #while [[ $old != $(stat -c '%Y' ci_log) ]]; do
42 # old=$(stat -c '%Y' ci_log)
43 # sleep 5
44 #done
46 tail -1 ci_log | grep expectations &>/dev/null
48 # did it pass the spec?
49 if [[ $? -ne 0 ]]; then
50 echo "bin/ci failed! `cat -v ci_log | sed -e 's/\^\[\[0;3[14]m//' -e 's/\^\[\[0m//' | $pastie`"
51 else
52 failures=$(tail -1 ci_log | cut -d' ' -f 5)
53 if [[ $failures -gt 0 ]]; then
54 echo "$(tail -1 ci_log); $(cat -v ci_log | sed -e 's/\^\[\[0;3[14]m//' -e 's/\^\[\[0m//' | $pastie)"
55 else
56 echo "$(tail -1 ci_log)"
60 # save some space, until it gets cleaned.
61 #rake distclean &>/dev/null
62 #rm -rf .git &>/dev/null
64 exit 0