diff options
author | Azul <azul@riseup.net> | 2013-08-26 12:21:08 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-08-27 14:16:54 +0200 |
commit | 3aa062ecb934731aa5876e60bb7c9086bcbb5742 (patch) | |
tree | 5db4872c19a63df4fb551eea912f2beac4df1575 | |
parent | b35146bf42bae91f1211b51dba568295f8d5b8f0 (diff) |
specify cwd when using git:changes
-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'; } |