aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/manifests/snapshot.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/manifests/snapshot.pp')
-rw-r--r--modules/git/manifests/snapshot.pp18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/git/manifests/snapshot.pp b/modules/git/manifests/snapshot.pp
index 8b903700..06473efe 100644
--- a/modules/git/manifests/snapshot.pp
+++ b/modules/git/manifests/snapshot.pp
@@ -1,22 +1,24 @@
define git::snapshot( $source,
$refresh = '*/5',
- $user = 'root') {
+ $user = 'root',
+ $branch = 'master') {
include git::client
#TODO
# should handle branch -> clone -n + branch + checkout
# create a script
- # Idealy, should be handled by vcsrepo
+ # Ideally, should be handled by vcsrepo
# https://github.com/bruce/puppet-vcsrepo
# once it is merged in puppet
- exec { "/usr/bin/git clone $source $name":
+ exec { "/usr/bin/git clone -b ${branch} ${source} ${name}":
creates => $name,
user => $user
}
- cron { "update $name":
- # FIXME no -q ?
- command => "cd $name && /usr/bin/git pull",
- user => $user,
- minute => $refresh
+ if ($refresh != '0') {
+ cron { "update ${name}":
+ command => "cd ${name} && /usr/bin/git pull -q && /usr/bin/git submodule --quiet update --init --recursive",
+ user => $user,
+ minute => $refresh
+ }
}
}