Deploying to Engine Yard via Ruby

Recently I've been playing with using Goldberg for Continuous Integration. CI is great, and what is also great is having a setup to auto-deploy to our Engine Yard staging server when all our tests pass. This isn't fully implemented yet, but I do have the deploy to EY working. I had to reverse-engineer the command-line script a bit to get this working. Here is how it's done for posterity:

 1
 2    require 'engineyard'
 3    require 'engineyard/cli'
 4
 5    EY.ui = EY::CLI::UI.new
 6
 7    x = EY::CLI.new
 8    x.options = {
 9      :app => nil,
10      :environment => "staging",
11      :ref => "master",
12      :migrate => true,
13      :extra_deploy_hook_options => {}
14    }
15
16    x.deploy
17
Filed under: ruby