Rails Continuous Deployment

2 views
Skip to first unread message

sto...@gmail.com

unread,
Jun 10, 2007, 10:44:47 AM6/10/07
to Ruby on Rails: Talk
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

Zach Inglis // LT3media

unread,
Jun 10, 2007, 11:11:00 AM6/10/07
to rubyonra...@googlegroups.com
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

MichaelLatta

unread,
Jun 10, 2007, 11:59:36 AM6/10/07
to Ruby on Rails: Talk
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...@readify.net" <stov...@gmail.com>
wrote:

christoph...@gmail.com

unread,
Jun 11, 2007, 1:33:17 PM6/11/07
to Ruby on Rails: Talk
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

unread,
Jun 12, 2007, 8:33:34 AM6/12/07
to rubyonra...@googlegroups.com
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, christoph...@gmail.com < christoph...@gmail.com> 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

Jacob Atzen

unread,
Jun 12, 2007, 10:39:31 AM6/12/07
to rubyonra...@googlegroups.com
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

unread,
Jun 12, 2007, 7:05:06 PM6/12/07
to rubyonra...@googlegroups.com
Thanks Jacob, I'll follow those instructions and stop spamming this list :)
Reply all
Reply to author
Forward
0 new messages