Permalink
Browse files

Ensure the log location exists before chmodding it

  • Loading branch information...
1 parent 3e706fc commit 8ef089ae541f6ad2327a09ca5cb2e8bcbdc7f0a9 @tomafro tomafro committed Dec 11, 2012
Showing with 2 additions and 0 deletions.
  1. +1 −0 lib/recap/tasks/foreman.rb
  2. +1 −0 spec/tasks/foreman_spec.rb
@@ -35,6 +35,7 @@ module Recap::Tasks::Foreman
desc 'Export foreman configuration'
task :default do
if deployed_file_exists?(procfile)
+ sudo "mkdir -p #{deploy_to}/log"
sudo "chown #{application_user}: #{deploy_to}/log"
as_app foreman_export_command
sudo "rm -f #{foreman_export_location}/#{application}*"
@@ -100,6 +100,7 @@
describe 'foreman:export' do
it 'runs the foreman export command, then moves the exported files to the export location' do
namespace.stubs(:deployed_file_exists?).with(config.procfile).returns(true)
+ namespace.expects(:sudo).with("mkdir -p #{config.deploy_to}/log").in_sequence(commands)
namespace.expects(:sudo).with("chown #{config.application_user}: #{config.deploy_to}/log").in_sequence(commands)
namespace.expects(:as_app).with(config.foreman_export_command).in_sequence(commands)
namespace.expects(:sudo).with("rm -f #{config.foreman_export_location}/#{config.application}*").in_sequence(commands)

0 comments on commit 8ef089a

Please sign in to comment.