Fullybaked-logo

fullybaked | davebaker

I'm a developer living in the UK and when I'm not spending time with my wife and our 2 wonderful little boys, I love hacking around with code

I'm passionate about technology, web development, gaming and fencing

27 February 2013

Ensure latest commits are pushed before deploy

This is a task I add to my capistrano recipes to ensure that the branch being deployed is always pushed to the remote prior to deploy

task :push do
  unless system "git push development #{branch}"
    raise Capistrano::Error, 'Git push failed'
  end
end

and just add the task to your before callback

before "deploy", "push"