Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

auto-install RVM if not installed

  • Loading branch information...
commit 938cb6d4587a17be06bbd0ac210c148558a65e62 1 parent d948581
@kohsuke kohsuke authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 models/rvm_wrapper.rb
View
10 models/rvm_wrapper.rb
@@ -16,11 +16,19 @@ def setup(build, launcher, listener)
before = StringIO.new()
if launcher.execute("bash","-c","export", {:out=>before})!=0 then
- listener << "Failed to fork bash"
+ listener << "Failed to fork bash\n"
listener << before.string
build.abort
end
+ if launcher.execute("bash","-c","test ! -f ~/.rvm/scripts/rvm")==0 then
+ listener << "Installing RVM\n"
+ installer = build.workspace+"rvm-installer"
+ installer.native.copyFrom(java.net.URL.new("https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer"))
+ installer.chmod(0755)
+ launcher.execute(installer.realpath, {:out=>listener})
+ end
+
after = StringIO.new()
if launcher.execute("bash","-c","source ~/.rvm/scripts/rvm && rvm_install_on_use_flag=1 && rvm use --create #{arg} && export > rvm.env", {:out=>listener,:chdir=>build.workspace})!=0 then
build.abort "Failed to setup RVM environment"
Please sign in to comment.
Something went wrong with that request. Please try again.