Topic: How to build when all test passes

I want to set up a continous build environment, so that ia any test fail it should not deploy the application. How to specify this condtion in Rakefile ?
Please help...

Re: How to build when all test passes

Well, the very easiest way to do this is a simple hack.  Just type:
rake && cap deploy

if the rake command (which is 'rake test:all' by default) fails it won't run the following commands on the line.
If you're on a Mac or *nix system you could put this in your ~/.bashrc file like this:
alias deploy='rake && cap deploy'

and then you'd just have to type 'deploy' to test your app and deploy it.

Re: How to build when all test passes

There was an article on this very subject released a couple days ago.

Railscasts - Free Ruby on Rails Screencasts

Re: How to build when all test passes

The problem is am using windows and the server is Mongrel. I am not using Capistrano for deployment. Am running the Rakefile from Luntbuild .In Rakefile I just copy the application on my test server to the development server. When I calling the rake it is doing the tests and copying the application to another server. But I don't know how to check if all test passes from the rake file so that, the copy task should  perform when all test passes.
         The main issue is how to check test status in rake file. I tried capistrano for the deployment, but it is showing errors 
Please help.

Re: How to build when all test passes

Capistrano is just basically some rake tasks, so I think you can still apply the instructions in that article I linked to. Just call the run_tests task before you do the copy. I don't have much experience with Rake at all, but I think that will work. Worth a try anyway. You may need to change some things since you don't have the "release_path".

Last edited by ryanb (2006-09-07 12:39:10)

Railscasts - Free Ruby on Rails Screencasts