THIS BLOG HAS MOVED TO blog.fearoffish.com

Did I do my Commit?

August 21st, 2007

It's been a while since I did a Ruby post, so I thought I'd fire out a simple task I just made for a customer. He wanted to be told when he hadn't committed changes to his svn repository when deploying his application. So I fired out this very simple task that merely exits if he didn't, the beauty of Capistrano (1.4.1 for this):

task :before_deploy do
  synced?
end

desc "Check local changes have been committed to the svn repository"
task :synced?, :roles => :app do
  output = `svn status`
  unless output.empty?
    puts "PLEASE COMMIT YOUR SVN CHANGES"
    exit(0)
  end
end

Simple, but effective.

Leave a Reply

Jamie van Dyke

Jamie van Dyke has been a Rails developer since the beginning of 2005, working with some of the major players in the web market. He also played a large part in the documenting of Rails for the Caboose Documentation Project and teaches others on his blog and in training sessions around the world. Jamie is a core Rails contributor, and the publisher of multiple gems and plugins.

I'm a father of 2, living in a little village called Skipton which is in North Yorkshire, England. Anything else you'd like to know you can ask. Check out my photo and info at the caboose facebook or my flickr page.

Jamie is also unsure why he must write a Bio in third person, and doesn't really have a fear of fish, he just dislikes the taste and smell of them.

< Recommend me on Working With Rails >

Search


Email:     


or    Subscribe in a Reader




 

Recommended Services

Basecamp project management and collaboration

Recommended Books