[chef] rake db:migrate failing on deploy resource


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Subject: [chef] rake db:migrate failing on deploy resource
  • Date: Fri, 2 Dec 2011 12:27:59 +0530

ohai,
i am struggling with `bundle exec rake db:migrate` (value of migration_command attribute in deploy resource) . This command fails with a return value 1. And without any further output or error messages.  Also, if i try the same manually from the current release directory it works. Also , i have tried with --trace and -v , still no output. Even further i tried running /bin/echo 'hello' as a migration command and that too fails. I think somehow the migration_command is not able to execute (irrespective of the command) anything.

Any idea what is going wrong? following is the deploy resource:

deploy_revision deploy_dir do
  repo node[:app][:repo]
  revision node[:app][:revision]
  enable_submodules false
  user deploy_user
  group deploy_user
  migrate true
  migration_command "bundle exec rake db:migrate v"
  environment({'RAILS_ENV' => node.chef_environment,'SOME_OTHER_VARIABLE'=>xxx })
  shallow_clone true
  action :deploy
  symlink_before_migrate "config/database.yml" => "config/database.yml"
  before_migrate do
    current_release = release_path
    execute "bundle install " do
      cwd current_release
    end
  end
  before_symlink do
    execute "bundle exec rake assets:precompile" do
      cwd current_release
    end
  end
end



  • [chef] rake db:migrate failing on deploy resource, Ranjib Dey, 12/01/2011

Archive powered by MHonArc 2.6.16.

§