-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit moves the backup cronjob to its own class. This ensures that backup configuration changes do not trigger a Gitlab service restart. Fixes #204.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# == Class gitlab::backup | ||
# | ||
# This class is called from gitlab for backup config. | ||
# | ||
class gitlab::backup { | ||
$rake_exec = $::gitlab::rake_exec | ||
$backup_cron_enable = $::gitlab::backup_cron_enable | ||
$backup_cron_minute = $::gitlab::backup_cron_minute | ||
$backup_cron_hour = $::gitlab::backup_cron_hour | ||
if empty($::gitlab::backup_cron_skips) { | ||
$backup_cron_skips = '' | ||
} else { | ||
$_backup_cron_skips = join($::gitlab::backup_cron_skips, ',') | ||
$backup_cron_skips = "SKIP=${_backup_cron_skips}" | ||
} | ||
|
||
if $backup_cron_enable { | ||
cron {'gitlab backup': | ||
command => "${rake_exec} gitlab:backup:create CRON=1 ${backup_cron_skips}", | ||
hour => $backup_cron_hour, | ||
minute => $backup_cron_minute, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters