Raimond Garcia
2008-Jan-08 16:43 UTC
[Backgroundrb-devel] Different environments in backgroudrb.yml
Hi, Got everything setup nicely with backgroundrb for the development environment and running tests with rspec. However, I have to keep editing the backgroundrb.yml file, to switch between development and testing environment. How can I declare a development, testing and production environment in backgroundrb.yml? Thanks in advance Rai
hemant kumar
2008-Jan-08 17:15 UTC
[Backgroundrb-devel] Different environments in backgroudrb.yml
Hi On Tue, 2008-01-08 at 17:43 +0100, Raimond Garcia wrote:> Hi, > > Got everything setup nicely with backgroundrb for the development > environment and running tests with rspec. However, I have to keep > editing the backgroundrb.yml file, to switch between development and > testing environment. How can I declare a development, testing and > production environment in backgroundrb.yml? > > Thanks in advancein your bdrb_test_helper.rb file put: RAILS_ENV = ''test'' at top and you are set.
Raimond Garcia
2008-Jan-08 17:49 UTC
[Backgroundrb-devel] Different environments in backgroudrb.yml
Cool, what about development and production environments? should I just not include the environment definition in backgroundrb.yml, and simply start the servers using the appropriate environment each time? for example RAILS_ENV=development ./script/backgroundrb start and RAILS_ENV=production ./script/backgroundrb start On Jan 8, 2008, at 6:15 PM, hemant kumar wrote:> Hi > On Tue, 2008-01-08 at 17:43 +0100, Raimond Garcia wrote: >> Hi, >> >> Got everything setup nicely with backgroundrb for the development >> environment and running tests with rspec. However, I have to keep >> editing the backgroundrb.yml file, to switch between development and >> testing environment. How can I declare a development, testing and >> production environment in backgroundrb.yml? >> >> Thanks in advance > > in your bdrb_test_helper.rb file put: > > RAILS_ENV = ''test'' at top and you are set. > > >
hemant kumar
2008-Jan-08 17:57 UTC
[Backgroundrb-devel] Different environments in backgroudrb.yml
Oh No, that won''t work out, for running BackgrounDRb itself, you must have proper entry in backgroundrb.yml file. So, I will suggest you to have different files for development and production environment and keep backgroundrb.yml file out of SVN. A cap task can copy backgroundrb.yml.production to backgroundrb.yml when deploying on machines. On Tue, 2008-01-08 at 18:49 +0100, Raimond Garcia wrote:> Cool, what about development and production environments? should I > just not include the environment definition in backgroundrb.yml, and > simply start the servers using the appropriate environment each time? > for example > > RAILS_ENV=development ./script/backgroundrb start > and > RAILS_ENV=production ./script/backgroundrb start > > > On Jan 8, 2008, at 6:15 PM, hemant kumar wrote: > > > Hi > > On Tue, 2008-01-08 at 17:43 +0100, Raimond Garcia wrote: > >> Hi, > >> > >> Got everything setup nicely with backgroundrb for the development > >> environment and running tests with rspec. However, I have to keep > >> editing the backgroundrb.yml file, to switch between development and > >> testing environment. How can I declare a development, testing and > >> production environment in backgroundrb.yml? > >> > >> Thanks in advance > > > > in your bdrb_test_helper.rb file put: > > > > RAILS_ENV = ''test'' at top and you are set. > > > > > > >
Dave Dupre
2008-Jan-08 18:22 UTC
[Backgroundrb-devel] Different environments in backgroudrb.yml
I use a cap task to generate the file rather than copy it. In cap 2.0: after "deploy:update_code", "backgroundrb:write_config" namespace :backgroundrb do desc "Write backgroundrb config file" task :write_config, :roles => :app do rails_env = fetch(:rails_env, ''production'') script = <<-SH :backgroundrb: :ip: localhost :port: 11006 :environment: #{rails_env} SH put script, "#{release_path}/config/backgroundrb.yml", :mode => 0644 end end end I use the same technique for my spin script and just about any file that needs slightly different contents depending on the environment. You can even use ERB to generate your apache scripts. I find it much easier than maintaining several versions of the same file. Dave On Jan 8, 2008 12:57 PM, hemant kumar <gethemant at gmail.com> wrote:> Oh No, that won''t work out, for running BackgrounDRb itself, you must > have proper entry in backgroundrb.yml file. > > So, I will suggest you to have different files for development and > production environment and keep backgroundrb.yml file out of SVN. A cap > task can copy backgroundrb.yml.production to backgroundrb.yml when > deploying on machines. > > > > On Tue, 2008-01-08 at 18:49 +0100, Raimond Garcia wrote: > > Cool, what about development and production environments? should I > > just not include the environment definition in backgroundrb.yml, and > > simply start the servers using the appropriate environment each time? > > for example > > > > RAILS_ENV=development ./script/backgroundrb start > > and > > RAILS_ENV=production ./script/backgroundrb start > > > > > > On Jan 8, 2008, at 6:15 PM, hemant kumar wrote: > > > > > Hi > > > On Tue, 2008-01-08 at 17:43 +0100, Raimond Garcia wrote: > > >> Hi, > > >> > > >> Got everything setup nicely with backgroundrb for the development > > >> environment and running tests with rspec. However, I have to keep > > >> editing the backgroundrb.yml file, to switch between development and > > >> testing environment. How can I declare a development, testing and > > >> production environment in backgroundrb.yml? > > >> > > >> Thanks in advance > > > > > > in your bdrb_test_helper.rb file put: > > > > > > RAILS_ENV = ''test'' at top and you are set. > > > > > > > > > > > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080108/603235e0/attachment-0001.html
Raimond Garcia
2008-Jan-08 18:48 UTC
[Backgroundrb-devel] Different environments in backgroudrb.yml
Great! Let me give you a little more context of my situation. We are trying to setup cruisecontrol, and so, I guess we should start backgroundrb in the test environment, run all the tests and then restart backgroundrb in the production environment so that it runs smoothly in staging and production. I guess both the solution to have different backgroundrb.yml files and running the appropriate capistrano tasks in the correct order would all work. I''ll talk to our lead developer in charge of cruisecontrol, and figure out how he is using capistrano to deal with testing environments and then apply your solutions to our specific case. Thanks guys! Rai On Jan 8, 2008, at 7:22 PM, Dave Dupre wrote:> I use a cap task to generate the file rather than copy it. > > In cap 2.0: > > after "deploy:update_code", "backgroundrb:write_config" > > namespace :backgroundrb do > desc "Write backgroundrb config file" > task :write_config, :roles => :app do > rails_env = fetch(:rails_env, ''production'') > script = <<-SH > :backgroundrb: > :ip: localhost > :port: 11006 > :environment: #{rails_env} > SH > put script, "#{release_path}/config/backgroundrb.yml", :mode => > 0644 > end > end > end > > I use the same technique for my spin script and just about any file > that needs slightly different contents depending on the > environment. You can even use ERB to generate your apache scripts. > I find it much easier than maintaining several versions of the same > file. > > Dave > > On Jan 8, 2008 12:57 PM, hemant kumar <gethemant at gmail.com> wrote: > Oh No, that won''t work out, for running BackgrounDRb itself, you must > have proper entry in backgroundrb.yml file. > > So, I will suggest you to have different files for development and > production environment and keep backgroundrb.yml file out of SVN. A > cap > task can copy backgroundrb.yml.production to backgroundrb.yml when > deploying on machines. > > > > On Tue, 2008-01-08 at 18:49 +0100, Raimond Garcia wrote: > > Cool, what about development and production environments? should I > > just not include the environment definition in backgroundrb.yml, and > > simply start the servers using the appropriate environment each > time? > > for example > > > > RAILS_ENV=development ./script/backgroundrb start > > and > > RAILS_ENV=production ./script/backgroundrb start > > > > > > On Jan 8, 2008, at 6:15 PM, hemant kumar wrote: > > > > > Hi > > > On Tue, 2008-01-08 at 17:43 +0100, Raimond Garcia wrote: > > >> Hi, > > >> > > >> Got everything setup nicely with backgroundrb for the development > > >> environment and running tests with rspec. However, I have to > keep > > >> editing the backgroundrb.yml file, to switch between > development and > > >> testing environment. How can I declare a development, testing > and > > >> production environment in backgroundrb.yml ? > > >> > > >> Thanks in advance > > > > > > in your bdrb_test_helper.rb file put: > > > > > > RAILS_ENV = ''test'' at top and you are set. > > > > > > > > > > > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080108/2bac2f00/attachment.html