aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/manifests/mirror.pp
blob: 0e0c30cddce01a5e5d599d155c679405208fa0b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
define git::mirror( $source,
                    $description,
                    $refresh = '*/5') {

    include git::common
    exec { "/usr/bin/git clone --bare $source $name":
        alias   => "git mirror $name",
        creates => $name,
        before  => File["$name/description"],
    }

    file { "$name/description":
        content => $description,
    }

    cron { "update $name":
        command => "cd $name ; /usr/bin/git fetch -q",
        minute  => $refresh
    }
}