Hi Jeff,

Sorry if I've created a red herring for you.  What I've provided  
probably won't solve your problem but it would keep your database  
username and password more secure.

Getting back to your problem, have you set up config/environments/ 
staging.rb including ENV['RAILS_ENV'] = 'staging'?

Keith

On 20/10/2008, at 2:29 PM, Jeff Pritchard wrote:

>
> Hi Keith,
> I appreciate the help, but you've left me a bit confused.  If I read
> this right, your addition is just going to add a staging section into
> the database.yml file on the fly during the deploy setup.  Seems  
> easier
> to just add it in for real.  Please explain what/why.
>
> thanks much,
> jp
>
>
>
>
> Keith Pitty wrote:
>> Hi Jeff,
>>
>> Within your config/deploy/staging.rb file something like the  
>> following
>> could help:
>>
>> require 'erb'
>>
>> before "deploy:setup", :db
>> after "deploy:update_code", "db:symlink"
>>
>> namespace :db do
>>   desc "Create database yaml in shared path"
>>   task :default do
>>     db_config = ERB.new <<-EOF
>> staging:
>>   adapter: mysql
>>   encoding: utf8
>>   username: #{user}
>>   password: #{password}
>>   database: #{application}_staging
>> EOF
>>
>>     run "mkdir -p #{shared_path}/config"
>>     put db_config.result, "#{shared_path}/config/database.yml"
>>   end
>>
>>   desc "Make symlink for database yaml"
>>   task :symlink do
>>     run "ln -nfs #{shared_path}/config/database.yml #{release_path}/
>> config/database.yml"
>>   end
>> end
>>
>> Regards,
>> Keith
>
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to