paul.stovell-sD9y6QqX6KzR7s880joybQ@public.gmane.org
2007-Jun-10 14:44 UTC
Rails Continuous Deployment
Hi all, I''ve successfully built a personal project using Rails (I come from the .NET world), and I''m now looking into deployment. Here''s what I want to do: - Store my application in source control (Subversion) - Whenever I checkin, kick off a continuous build and deployment process (on the build machine) that will: - Deploy the MySQL database to the web server (myapp_testing) - Copy the ruby application files to a virtual directory (test.myapp.com) so that I can view it online In the .NET world I would have done this using CruiseControl.NET and NAnt, running OSQL.exe to deploy the database from a .SQL script file. Is the process similar for a Rails application, or is there a much more "rails-y" way to do it? I notice that the database.yml files point to dev, test and production databases. But where do you tell the application whether to use production/test or not? Also, how do you handle changes between schema versions and deploying them? Any ideas would be appreciated - I can always do it the .NET way but I''d prefer to use a more standard way if I can. Paul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You could check out CruiseControl.rb ( http:// cruisecontrolrb.thoughtworks.com/ ). You could also look into Capistrano ( www.capify.org ) There is a method to change which environment. Cheers, Zach Inglis → Blog -- http://www.zachinglis.com → Company -- http://www.lt3media.com → Portfolio -- http://portfolio.zachinglis.com On Jun 10, 2007, at 9:44 AM, paul.stovell-sD9y6QqX6KzR7s880joybQ@public.gmane.org wrote:> > Hi all, > > I''ve successfully built a personal project using Rails (I come from > the .NET world), and I''m now looking into deployment. Here''s what I > want to do: > > - Store my application in source control (Subversion) > - Whenever I checkin, kick off a continuous build and deployment > process (on the build machine) that will: > - Deploy the MySQL database to the web server (myapp_testing) > - Copy the ruby application files to a virtual directory > (test.myapp.com) so that I can view it online > > In the .NET world I would have done this using CruiseControl.NET and > NAnt, running OSQL.exe to deploy the database from a .SQL script file. > Is the process similar for a Rails application, or is there a much > more "rails-y" way to do it? > > I notice that the database.yml files point to dev, test and production > databases. But where do you tell the application whether to use > production/test or not? > > Also, how do you handle changes between schema versions and deploying > them? > > Any ideas would be appreciated - I can always do it the .NET way but > I''d prefer to use a more standard way if I can. > > Paul > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rails uses a system called migrations for database schema management. Each migration (just a ruby file) has a script that can update the schema from the prior to the next version or the reverse. You can then use the db:migrate rake task to migrate a database from one version to another or to the latest version. These files are stored in CM just like other source files. There are several continuos integration frameworks that do the auto-build after a check-in. There may also be a CruiseControl version for Rails. SVN seems to be the predominant CM tool used with Rails, and MySQL is well supported as well. Michael On Jun 10, 7:44 am, "paul.stov...-sD9y6QqX6KzR7s880joybQ@public.gmane.org" <stov...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I''ve successfully built a personal project using Rails (I come from > the .NET world), and I''m now looking into deployment. Here''s what I > want to do: > > - Store my application in source control (Subversion) > - Whenever I checkin, kick off a continuous build and deployment > process (on the build machine) that will: > - Deploy the MySQL database to the web server (myapp_testing) > - Copy the ruby application files to a virtual directory > (test.myapp.com) so that I can view it online > > In the .NET world I would have done this using CruiseControl.NET and > NAnt, running OSQL.exe to deploy the database from a .SQL script file. > Is the process similar for a Rails application, or is there a much > more "rails-y" way to do it? > > I notice that the database.yml files point to dev, test and production > databases. But where do you tell the application whether to use > production/test or not? > > Also, how do you handle changes between schema versions and deploying > them? > > Any ideas would be appreciated - I can always do it the .NET way but > I''d prefer to use a more standard way if I can. > > Paul--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
christophermatthieu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-11 17:33 UTC
Re: Rails Continuous Deployment
Check out Rubyology''s podcast #5 (http://rubyology.com/podcasts/show/ 11) for Rails deployment strategies and tips on Subversion, Capistrano, and Secure Shell Regards, Chris Matthieu http://www.rubyology.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks guys, I ended up going with CruiseControl.NET (since I am already using it for other projects - it''s nice to see them all from the one panel) but using custom rake tasks to do the deployment and configuration. The issue I''m having now is with deployment. I tried a heap of methods on Apache as well as IIS (all on Windows 2003) but couldn''t get any of them working. What kind of server is every body using? The nightmare of deploying a rails app has really gotten me down :( Cheers, Paul On 6/12/07, christophermatthieu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <christophermatthieu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Check out Rubyology''s podcast #5 (http://rubyology.com/podcasts/show/ > 11) for Rails deployment strategies and tips on Subversion, > Capistrano, and Secure Shell > > Regards, > Chris Matthieu > http://www.rubyology.com > > > > >-- Paul Stovell http://www.paulstovell.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paul Stovell wrote:> Thanks guys, > > I ended up going with CruiseControl.NET (since I am already using it for > other projects - it''s nice to see them all from the one panel) but using > custom rake tasks to do the deployment and configuration. > > The issue I''m having now is with deployment. I tried a heap of methods > on Apache as well as IIS (all on Windows 2003) but couldn''t get any of > them working. What kind of server is every body using? The nightmare of > deploying a rails app has really gotten me down :(Apache + Mongrel. Helper tools: Mongrel Cluster and Capistrano. I used Coda Hales walkthrough to get started, it''s a pretty good end to end description: http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/ Notice, there''s a rails-deployment group where all the experts are hanging out ;-) -- Cheers, - Jacob Atzen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Jacob, I''ll follow those instructions and stop spamming this list :) On 6/13/07, Jacob Atzen <jacob-4U2y0bnePT5NzRJJ8cAMrg@public.gmane.org> wrote:> > > Paul Stovell wrote: > > Thanks guys, > > > > I ended up going with CruiseControl.NET (since I am already using it for > > other projects - it''s nice to see them all from the one panel) but using > > custom rake tasks to do the deployment and configuration. > > > > The issue I''m having now is with deployment. I tried a heap of methods > > on Apache as well as IIS (all on Windows 2003) but couldn''t get any of > > them working. What kind of server is every body using? The nightmare of > > deploying a rails app has really gotten me down :( > > Apache + Mongrel. Helper tools: Mongrel Cluster and Capistrano. I used > Coda Hales walkthrough to get started, it''s a pretty good end to end > description: > > > http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/ > > Notice, there''s a rails-deployment group where all the experts are > hanging out ;-) > > -- > Cheers, > - Jacob Atzen > > > >-- Paul Stovell http://www.paulstovell.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---