# default cron env is "/usr/bin:/bin" which is not sufficient as govuk_env is in /usr/local/bin
env :PATH, '/usr/local/bin:/usr/bin:/bin'
set :output, {:error => 'log/cron.error.log', :standard => 'log/cron.log'}
job_type :rake, 'cd :path && /usr/local/bin/govuk_setenv transition bundle exec rake :task :output'

# Run when the file has just been generated.
# It appears to take ~50 minutes to generate based on the Last Modified HTTP header
#
# At the time of writing, the file is generated twice a day:
# https://github.com/alphagov/whitehall/blob/master/config/schedule.rb#L18
every :day, at: ['3:30am', '1:15pm'] do
  rake 'import:whitehall:mappings'
end

# default cron env is "/usr/bin:/bin" which is not sufficient as govuk_env is in /usr/local/bin
env :PATH, '/usr/local/bin:/usr/bin:/bin'
set :output, {:error => 'log/cron.error.log', :standard => 'log/cron.log'}
job_type :rake, 'cd :path && /usr/local/bin/govuk_setenv transition bundle exec rake :task :output'

# Run when the file has just been generated.
# It appears to take ~50 minutes to generate based on the Last Modified HTTP header
#
# At the time of writing, the file is generated twice a day:
# https://github.com/alphagov/whitehall/blob/master/config/schedule.rb#L18
every :day, at: ['3:30am', '1:15pm'] do
  rake 'import:whitehall:mappings'
end

every :hour do
  rake 'import:dns_details'
end

Update Host CNAMEs every hour
Update Host CNAMEs every hour

This will mean that the transition status for a site will be more up-to-date
if it has transitioned today. Currently this happens at midnight when data is
imported from Redirector.
