Dduvall has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/156207

Change subject: Central bundler gem installation path for faster provisions
......................................................................

Central bundler gem installation path for faster provisions

Modified the gem installation path specified by browsertests::bundle to
a central location, greatly reducing the overall provisioning cost for
browser-test dependencies across roles.

Change-Id: I1f823212e648bb641e3663e538378e151af34462
---
M puppet/modules/browsertests/manifests/bundle.pp
M puppet/modules/ruby/manifests/bundle.pp
2 files changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/07/156207/1

diff --git a/puppet/modules/browsertests/manifests/bundle.pp 
b/puppet/modules/browsertests/manifests/bundle.pp
index 26004d2..6714d80 100644
--- a/puppet/modules/browsertests/manifests/bundle.pp
+++ b/puppet/modules/browsertests/manifests/bundle.pp
@@ -21,6 +21,7 @@
     ruby::bundle { $title:
         directory  => $directory,
         missing_ok => true,
+        path       => '/home/vagrant/.gem',
     }
 }
 
diff --git a/puppet/modules/ruby/manifests/bundle.pp 
b/puppet/modules/ruby/manifests/bundle.pp
index 03f386c..434de0c 100644
--- a/puppet/modules/ruby/manifests/bundle.pp
+++ b/puppet/modules/ruby/manifests/bundle.pp
@@ -54,14 +54,25 @@
         default => "test ! -e '${bundle_gemfile}' || ",
     }
 
+    exec { "bundle_config_path_${title}":
+        command     => "${bundle} config --local path '${path}'",
+        provider    => 'shell',
+        cwd         => $directory,
+        environment => "BUNDLE_GEMFILE=${bundle_gemfile}",
+        user        => $user,
+        unless      => "${guard}${bundle} config --local path | grep -q 
'\"${path}\"'",
+        timeout     => 60 * 20,
+        require     => Ruby::Ruby[$ruby],
+    }
+
     exec { "bundle_install_${title}":
-        command     => "${bundle} install --path '${path}'",
+        command     => "${bundle} install",
         provider    => 'shell',
         cwd         => $directory,
         environment => "BUNDLE_GEMFILE=${bundle_gemfile}",
         user        => $user,
         unless      => "${guard}${bundle} check",
         timeout     => 60 * 20,
-        require     => Ruby::Ruby[$ruby],
+        require     => Exec["bundle_config_path_${title}"],
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/156207
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f823212e648bb641e3663e538378e151af34462
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Dduvall <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to