1 |
define git::snapshot( $source, |
2 |
$refresh = '*/5', |
3 |
$user = 'root') { |
4 |
include git::client |
5 |
#TODO |
6 |
# should handle branch -> clone -n + branch + checkout |
7 |
# create a script |
8 |
# Idealy, should be handled by vcsrepo |
9 |
# https://github.com/bruce/puppet-vcsrepo |
10 |
# once it is merged in puppet |
11 |
exec { "/usr/bin/git clone $source $name": |
12 |
creates => $name, |
13 |
user => $user |
14 |
} |
15 |
|
16 |
cron { "update $name": |
17 |
# FIXME no -q ? |
18 |
command => "cd $name && /usr/bin/git pull", |
19 |
user => $user, |
20 |
minute => $refresh |
21 |
} |
22 |
} |