Puppet Class: bitbucket::gc

Defined in:
manifests/gc.pp

Overview

Class: bitbucket::gc

Class to run git gc on bitbucket repo’s at regular intervals

Parameters

ensure

enable or disable cron job to run git garabage collection.

path

Default path to install script to.

weekday

Day of the week to run script on, default is Sunday at midnight.

Examples

class { ‘bitbucket::gc’: }

Parameters:

  • ensure (Any) (defaults to: 'present')
  • path (Any) (defaults to: '/usr/local/bin/git-gc.sh')
  • minute (Any) (defaults to: 0)
  • hour (Any) (defaults to: 0)
  • weekday (Any) (defaults to: 'Sunday')
  • user (Any) (defaults to: $bitbucket::user)
  • homedir (Any) (defaults to: $bitbucket::homedir)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'manifests/gc.pp', line 18

class bitbucket::gc(
  $ensure  = 'present',
  $path    = '/usr/local/bin/git-gc.sh',
  $minute  = 0,
  $hour    = 0,
  $weekday = 'Sunday',
  $user    = $bitbucket::user,
  $homedir = $bitbucket::homedir,
  ) {

  include ::bitbucket::params

  if $::bitbucket_version and versioncmp($::bitbucket_version, '3.2') < 0 {
    $shared = ''
  } else {
    $shared = '/shared'
  }

  file { $path:
    ensure  => $ensure,
    content => template('bitbucket/git-gc.sh.erb'),
    mode    => '0755',
  } ->

  cron { 'git-gc-bitbucket':
    ensure  => $ensure,
    command => "${path} &>/dev/null",
    user    => $user,
    minute  => $minute,
    hour    => $hour,
    weekday => $weekday,
  }

}