summaryrefslogtreecommitdiff
path: root/puppet/modules/site_static/manifests
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-06-03 12:02:09 -0700
committerelijah <elijah@riseup.net>2016-06-03 12:02:09 -0700
commit2e5657647ed790eec8bd679c47eb57bd4eaed621 (patch)
treedbf9ddd140f9b8f4a0656b3c779b8ee607a2ba98 /puppet/modules/site_static/manifests
parent8ce5fe27d53e0e1f5f36a9de812069a823d59222 (diff)
auto run bundler when needed for site_static
Diffstat (limited to 'puppet/modules/site_static/manifests')
-rw-r--r--puppet/modules/site_static/manifests/location.pp13
1 files changed, 13 insertions, 0 deletions
diff --git a/puppet/modules/site_static/manifests/location.pp b/puppet/modules/site_static/manifests/location.pp
index d116de2f..ab2b7494 100644
--- a/puppet/modules/site_static/manifests/location.pp
+++ b/puppet/modules/site_static/manifests/location.pp
@@ -23,6 +23,19 @@ define site_static::location($path, $format, $source) {
}
}
+ if ($format == 'rack') {
+ # Run bundler if there is a Gemfile
+ exec { 'bundler_update':
+ cwd => $file_path,
+ command => '/bin/bash -c "/usr/bin/bundle check --path vendor/bundle || /usr/bin/bundle install --path vendor/bundle --without test development debug"',
+ unless => '/usr/bin/bundle check --path vendor/bundle',
+ onlyif => 'test -f Gemfile',
+ user => 'www-data',
+ timeout => 600,
+ require => [Class['bundler::install'], Class['site_config::ruby::dev']];
+ }
+ }
+
vcsrepo { $file_path:
ensure => present,
force => true,