summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-02-21 21:17:46 +0100
committervarac <varacanero@zeromail.org>2017-02-23 17:48:10 +0100
commitc92894bac76da3bb980cf2052dafd2c22520484d (patch)
tree82dd3f9aacd2ce0f770eb3459f852ab90e61a97f
parentab5f9ccfe525e39dc1d6c77f12ad68878038f2c0 (diff)
Cleanup modified Gemfile.lock before pulling nickserver vcsrepoclean_vcsrepo
Resolves: #8492
-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..1dbb01e1 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 => 'bash -c "/usr/bin/bundle config --local frozen 1; /usr/bin/bundle check"',
user => 'nickserver',
timeout => 600,
require => [