Parent Directory | Revision Log
add basic git hosting, using xinetd
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 | # TODO | ||
32 | |||
33 | } | ||
34 | |||
35 | class client inherits common { | ||
36 | |||
37 | |||
38 | } | ||
39 | |||
40 | define snapshot($source, $refresh ='*/5', $user = 'root') { | ||
41 | include git::client | ||
42 | #TODO | ||
43 | # should handle branch -> clone -n + branch + checkout | ||
44 | # create a script | ||
45 | # Idealy, should be handled by vcsrepo https://github.com/bruce/puppet-vcsrepo | ||
46 | # once it is merged in puppet | ||
47 | exec { "/usr/bin/git clone $source $name": | ||
48 | creates => $name, | ||
49 | user => $user | ||
50 | } | ||
51 | |||
52 | cron { "update $name": | ||
53 | # FIXME no -q ? | ||
54 | command => "cd $name && /usr/bin/git pull", | ||
55 | user => $user, | ||
56 | minute => $refresh | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | |||
61 | |||
62 |
ViewVC Help | |
Powered by ViewVC 1.1.30 |