Method: CachedDeploy#migrate

Defined in:
lib/chef-deploy/cached_deploy.rb

#migrateObject



92
93
94
95
96
97
98
99
100
# File 'lib/chef-deploy/cached_deploy.rb', line 92

def migrate
  if @configuration[:migrate]
    chef_run "ln -nfs #{shared_path}/config/database.yml #{latest_release}/config/database.yml"
    chef_run "ln -nfs #{shared_path}/log #{latest_release}/log"
    Chef::Log.info "Migrating: cd #{latest_release} && sudo -u #{user} RAILS_ENV=#{@configuration[:environment]} RACK_ENV=#{@configuration[:environment]} MERB_ENV=#{@configuration[:environment]} #{@configuration[:migration_command]}"
    chef_run("chown -R #{user}:#{group} #{latest_release}")
    chef_run("cd #{latest_release} && sudo -u #{user} RAILS_ENV=#{@configuration[:environment]} RACK_ENV=#{@configuration[:environment]} MERB_ENV=#{@configuration[:environment]} #{@configuration[:migration_command]}")
  end
end