diff --git a/Backup/models/my_backup.rb b/Backup/models/my_backup.rb index b6ab575fc..521c4dbd5 100644 --- a/Backup/models/my_backup.rb +++ b/Backup/models/my_backup.rb @@ -11,8 +11,8 @@ # require 'yaml' Model.new(:my_backup, 'Description for my_backup') do - env_file = File.join(Rails.root, 'config', 'local_env.yml') - defaults = File.join(Rails.root, 'config', 'sample.local_env.yml') + env_file = File.dirname(__FILE__) + '/../../config/local_env.yml' + defaults = File.dirname(__FILE__) + '/../../config/sample.local_env.yml' YAML.load(File.open(env_file)).each do |key, value| ENV[key.to_s] = value diff --git a/config/deploy.rb b/config/deploy.rb index a4a7e859f..40ecd9907 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -4,12 +4,16 @@ require 'rvm/capistrano' require 'rvm/capistrano/gem_install_uninstall' -#loading environment variables so we can all use the same deployment +# loading environment variables so we can all use the same deployment YAML.load(File.open(File.dirname(__FILE__) + '/local_env.yml')).each do |key, value| ENV[key.to_s] = value puts ENV[key.to_s] end if File.exist?(File.dirname(__FILE__) + '/local_env.yml') +# loading in defaults +YAML.load(File.open(File.dirname(__FILE__) + '/sample.local_env.yml')).each do |key, value| + ENV[key.to_s] = value +end set :repository, ENV['GIT_REPOSITORY'] diff --git a/config/schedule.rb b/config/schedule.rb index 0e5a5cb96..00149393d 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -5,8 +5,8 @@ # loading our environment variables and defaults require 'yaml' -env_file = File.join(Rails.root, 'config', 'local_env.yml') -defaults = File.join(Rails.root, 'config', 'sample.local_env.yml') +env_file = File.dirname(__FILE__) + '/local_env.yml' +defaults = File.dirname(__FILE__) + '/sample.local_env.yml' YAML.load(File.open(env_file)).each do |key, value| ENV[key.to_s] = value @@ -16,7 +16,10 @@ YAML.load(File.open(defaults)).each do |key, value| ENV[key.to_s] = value unless ENV[key] end + path = File.expand_path(File.dirname(File.dirname(__FILE__))) + +# run our jobs in the right time zone set :job_template, "TZ=\"#{ENV['TIME_ZONE']}\" bash -l -c ':job'" set :output, "#{path}/log/cron_log.log" #