Author: donaldp
Date: Sat Oct 6 01:42:44 2012
New Revision: 1394890
URL: http://svn.apache.org/viewvc?rev=1394890&view=rev
Log:
Add in some magic to auto install RVM when needed so that the ci jobs can run
on nodes other than ubuntu2
Modified:
buildr/trunk/ci.sh
Modified: buildr/trunk/ci.sh
URL:
http://svn.apache.org/viewvc/buildr/trunk/ci.sh?rev=1394890&r1=1394889&r2=1394890&view=diff
==============================================================================
--- buildr/trunk/ci.sh (original)
+++ buildr/trunk/ci.sh Sat Oct 6 01:42:44 2012
@@ -38,6 +38,25 @@ else
export BUILDR_RUBY_VERSION=ruby-1.9.3-p0
fi
+# TODO: Use traps to remove lock files
+# See
http://stackoverflow.com/questions/169964/how-to-prevent-a-script-from-running-simultaneously
+
+if [[ ! -s "$HOME/.rvm/scripts/rvm" ]]; then
+ curl -L https://get.rvm.io | bash -s stable
+ source "$HOME/.rvm/scripts/rvm"
+ touch "$HOME/.rvm_ci_update"
+elif mkdir "$HOME/.rvm_lock"; then
+ if [[ ! -s "$HOME/.rvm_ci_update" ]]; then
+ touch "$HOME/.rvm_ci_update"
+ fi
+ if test `find $HOME/.rvm_ci_update -mmin +7200`; then
+ source "$HOME/.rvm/scripts/rvm"
+ rvm get stable
+ touch "$HOME/.rvm_ci_update"
+ fi
+ rmdir "$HOME/.rvm_lock"
+fi
+
# Consider updating RVM to the latest version.
# Get a lock on the directory prior to this action
#rvm get stable --auto