From d6f44e4a510a1ce03fb4b261d712ff5062f889c0 Mon Sep 17 00:00:00 2001 From: Nicola Brisotto Date: Thu, 21 Nov 2013 09:59:23 +0000 Subject: [PATCH] Fix close file --- lib/tasks/eb_fast_deploy.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/tasks/eb_fast_deploy.rb b/lib/tasks/eb_fast_deploy.rb index 16ad337..439e1d8 100644 --- a/lib/tasks/eb_fast_deploy.rb +++ b/lib/tasks/eb_fast_deploy.rb @@ -273,12 +273,12 @@ def print_env set_vars if @eb_ruby_container_options["WHENEVER_ALL"] == "true" template=<<-EOF -commands: - 01whenever: - command: bundle exec whenever --set environment=$RACK_ENV -u webapp --update-crontab >/tmp/whenever_command.log 2>&1 +container_commands: + 02whenever: + command: bundle exec whenever --set environment=$RAILS_ENV -u webapp --update-crontab >/tmp/whenever_command.log 2>&1 leader_only: false - EOF - output_file = ".ebextensions/whenever_all.config" +EOF + output_file = ".ebextensions/whenever.config" dir = File.dirname output_file unless File.directory?(dir) FileUtils.mkdir_p(dir) @@ -286,6 +286,7 @@ def print_env File.delete output_file if File.exists? output_file output = File.open(File.join(Rails.root, output_file), "w") output << ERB.new( template).result(binding) + output.close end end