Return git clone step for ruby-build to ensureRubyEnv function
- Returning this step which was removed prviously, because we need
to override old ruby-build package installed on Jenkins slaves
- Remove unused variable and unnecesary rm step
Fixes: PROD-29321
Change-Id: I0a84449bc3bcd03ef2a94bd648030b4b212d370e
diff --git a/src/com/mirantis/mk/Ruby.groovy b/src/com/mirantis/mk/Ruby.groovy
index 7802a11..8fac324 100644
--- a/src/com/mirantis/mk/Ruby.groovy
+++ b/src/com/mirantis/mk/Ruby.groovy
@@ -9,13 +9,12 @@
* @param rubyVersion target ruby version (optional, default 2.2.3)
*/
def ensureRubyEnv(rubyVersion="2.4.1"){
- def ruby_build_root = "${env.WORKSPACE}/.rbenv/plugins/ruby-build"
if (!fileExists("/var/lib/jenkins/.rbenv/versions/${rubyVersion}/bin/ruby")){
//XXX: patch ruby-build because debian package is quite old
+ sh "git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build || git -C ~/.rbenv/plugins/ruby-build pull"
sh "rbenv install ${rubyVersion} -sv";
}
sh "rbenv local ${rubyVersion};rbenv exec gem update --system"
- sh "rm -rf ${ruby_build_root}"
}
/**