Commit 44480708 authored by Jeroen Nijhof's avatar Jeroen Nijhof

Add pre_command for cronjob

parent 4aac3643
# 0.3.13
- Add pre_command for backup cronjob
# 0.3.12
- Add sidekiq-cluster service
......
......@@ -46,3 +46,4 @@ default['omnibus-gitlab']['backup_cron_job']['minute'] = '30'
default['omnibus-gitlab']['backup_cron_job']['weekday'] = nil # defaults to '*', every day
default['omnibus-gitlab']['backup_cron_job']['user'] = 'root'
default['omnibus-gitlab']['backup_cron_job']['enable'] = true
default['omnibus-gitlab']['backup_cron_job']['pre_command'] = ''
......@@ -4,7 +4,7 @@ maintainer_email 'marin@gitlab.com'
license 'All rights reserved'
description 'Installs/Configures GitLab using omnibus-gitlab'
long_description 'Installs/Configures GitLab using omnibus-gitlab'
version '0.3.12'
version '0.3.13'
issues_url 'https://gitlab.com/gitlab-org/cookbook-omnibus-gitlab/issues'
source_url 'https://gitlab.com/gitlab-org/cookbook-omnibus-gitlab/'
......
......@@ -10,17 +10,9 @@
#
backup_cron_job = node['omnibus-gitlab']['backup_cron_job']
pre_command = backup_cron_job['pre_command']
options = ''
remote_file '/usr/local/bin/chronic' do
source 'http://habilis.net/cronic/cronic'
owner 'root'
group 'root'
checksum '25d9772e142ebdcaa72433431e26d855ae82b085709faf0d2169b3bda867aeac'
mode '0755'
action :create_if_missing
end
if backup_cron_job['skip'].any?
options << " SKIP=#{backup_cron_job['skip'].join(',')}"
end
......@@ -28,7 +20,7 @@ end
options << ' CRON=1' if backup_cron_job['silent']
cron 'GitLab backup' do
command "/opt/gitlab/bin/gitlab-rake gitlab:backup:create #{options}"
command "#{pre_command}/opt/gitlab/bin/gitlab-rake gitlab:backup:create #{options}"
hour backup_cron_job['hour']
minute backup_cron_job['minute']
weekday backup_cron_job['weekday']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment