Parent Directory | Revision Log
start the repository type ( create it )
1 | misc | 795 | class git { |
2 | class common { | ||
3 | package { 'git-core': | ||
4 | } | ||
5 | } | ||
6 | |||
7 | class server inherits common { | ||
8 | misc | 796 | $git_base_path = '/git/' |
9 | |||
10 | xinetd::service { "git": | ||
11 | content => template('git/xinetd') | ||
12 | } | ||
13 | |||
14 | file { "$git_base_path": | ||
15 | ensure => directory | ||
16 | } | ||
17 | |||
18 | misc | 795 | # TODO |
19 | # define common syntax check, see svn | ||
20 | # proper policy : no-fast-forward | ||
21 | # no branch ? | ||
22 | # no binary | ||
23 | # no big file | ||
24 | # no empty commit message, no root | ||
25 | # automated push to another git repo ( see http://noone.org/blog/English/Computer/VCS/Thoughts%20on%20Gitorious%20and%20GitHub%20plus%20a%20useful%20git%20hook.futile | ||
26 | # | ||
27 | # how do we handle commit permission ? | ||
28 | } | ||
29 | |||
30 | define repository { | ||
31 | misc | 797 | exec { "git init --bare $name": |
32 | creates => $name, | ||
33 | } | ||
34 | misc | 795 | |
35 | } | ||
36 | |||
37 | class client inherits common { | ||
38 | |||
39 | |||
40 | } | ||
41 | |||
42 | define snapshot($source, $refresh ='*/5', $user = 'root') { | ||
43 | include git::client | ||
44 | #TODO | ||
45 | # should handle branch -> clone -n + branch + checkout | ||
46 | # create a script | ||
47 | # Idealy, should be handled by vcsrepo https://github.com/bruce/puppet-vcsrepo | ||
48 | # once it is merged in puppet | ||
49 | exec { "/usr/bin/git clone $source $name": | ||
50 | creates => $name, | ||
51 | user => $user | ||
52 | } | ||
53 | |||
54 | cron { "update $name": | ||
55 | # FIXME no -q ? | ||
56 | command => "cd $name && /usr/bin/git pull", | ||
57 | user => $user, | ||
58 | minute => $refresh | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | |||
63 | |||
64 |
ViewVC Help | |
Powered by ViewVC 1.1.30 |