diff options
Diffstat (limited to 'puppet/modules/site_webapp/manifests')
-rw-r--r-- | puppet/modules/site_webapp/manifests/git.pp | 5 | ||||
-rw-r--r-- | puppet/modules/site_webapp/manifests/init.pp | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/puppet/modules/site_webapp/manifests/git.pp b/puppet/modules/site_webapp/manifests/git.pp index 25862707..908bc1a4 100644 --- a/puppet/modules/site_webapp/manifests/git.pp +++ b/puppet/modules/site_webapp/manifests/git.pp @@ -1,11 +1,12 @@ # Usage # git::changes { name: +# cwd => "/path/to/git/" # user => "me", # ensure => {*assume-unchanged*, tracked} # } # -define git::changes ( $user, $ensure='assume-unchanged' ) { +define git::changes ( $cwd, $user, $ensure='assume-unchanged' ) { case $ensure { default: { err ( "unknown ensure value '${ensure}'" ) } @@ -13,6 +14,7 @@ define git::changes ( $user, $ensure='assume-unchanged' ) { assume-unchanged: { exec { "assume-unchanged ${name}": command => "/usr/bin/git update-index --assume-unchanged ${name}", + cwd => $cwd, user => $user, unless => "/usr/bin/git ls-files -v | grep '^[ch] ${name}'", } @@ -21,6 +23,7 @@ define git::changes ( $user, $ensure='assume-unchanged' ) { tracked: { exec { "assume-unchanged ${name}": command => "/usr/bin/git update-index --no-assume-unchanged ${name}", + cwd => $cwd, user => $user, onlyif => "/usr/bin/git ls-files -v | grep '^[ch] ${name}'", } diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp index a8807a1a..4bae2088 100644 --- a/puppet/modules/site_webapp/manifests/init.pp +++ b/puppet/modules/site_webapp/manifests/init.pp @@ -138,14 +138,17 @@ class site_webapp { source => $webapp['img_dir']; } - git:changes { - '/srv/leap/webapp/app/assets/stylesheets/head.scss': + git::changes { + 'app/assets/stylesheets/head.scss': + cwd => '/srv/leap/webapp', user => 'leap-webapp'; - '/srv/leap/webapp/app/assets/stylesheets/tail.scss': + 'app/assets/stylesheets/tail.scss': + cwd => '/srv/leap/webapp', user => 'leap-webapp'; - '/srv/leap/webapp/public/favicon.ico': + 'public/favicon.ico': + cwd => '/srv/leap/webapp', user => 'leap-webapp'; } |