summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nickserver
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-02-21 21:17:46 +0100
committervarac <varacanero@zeromail.org>2017-02-23 18:52:59 +0100
commit15d2a330d3382306b80e3bd773604f0a6f0c79d5 (patch)
tree0386b0cac1808a7151b4ced541d4c1bd9afe0331 /puppet/modules/site_nickserver
parentab5f9ccfe525e39dc1d6c77f12ad68878038f2c0 (diff)
Cleanup modified Gemfile.lock before pulling nickserver vcsrepo
Resolves: #8492
Diffstat (limited to 'puppet/modules/site_nickserver')
-rw-r--r--puppet/modules/site_nickserver/manifests/init.pp17
1 files changed, 13 insertions, 4 deletions
diff --git a/puppet/modules/site_nickserver/manifests/init.pp b/puppet/modules/site_nickserver/manifests/init.pp
index 12236b3b..8ef47b07 100644
--- a/puppet/modules/site_nickserver/manifests/init.pp
+++ b/puppet/modules/site_nickserver/manifests/init.pp
@@ -61,21 +61,30 @@ class site_nickserver {
require => Group['nickserver'];
}
+ # Eariler we used bundle install without --deployment
+ exec { 'clean_git_repo':
+ cwd => '/srv/leap/nickserver',
+ user => 'nickserver',
+ command => '/usr/bin/git checkout Gemfile.lock',
+ onlyif => '/usr/bin/git status | /bin/grep -q "modified: *Gemfile.lock"',
+ require => Package['git']
+ }
+
vcsrepo { '/srv/leap/nickserver':
- ensure => present,
+ ensure => latest,
revision => $sources['nickserver']['revision'],
provider => $sources['nickserver']['type'],
source => $sources['nickserver']['source'],
owner => 'nickserver',
group => 'nickserver',
- require => [ User['nickserver'], Group['nickserver'] ],
+ require => [ User['nickserver'], Group['nickserver'], Exec['clean_git_repo'] ],
notify => Exec['nickserver_bundler_update'];
}
exec { 'nickserver_bundler_update':
cwd => '/srv/leap/nickserver',
- command => '/bin/bash -c "/usr/bin/bundle check || /usr/bin/bundle install --path vendor/bundle"',
- unless => '/usr/bin/bundle check',
+ command => '/usr/bin/bundle install --deployment',
+ unless => '/bin/bash -c "/usr/bin/bundle config --local frozen 1; /usr/bin/bundle check"',
user => 'nickserver',
timeout => 600,
require => [