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:


    require 'engineyard'
    require 'engineyard/cli'

    EY.ui = EY::CLI::UI.new

    x = EY::CLI.new
    x.options = {
      :app => nil,
      :environment => "staging",
      :ref => "master",
      :migrate => true,
      :extra_deploy_hook_options => {}
    }

    x.deploy

Filed under: ruby