Archive for January 2014

I moved my config into yaml files

January 23, 2014

My rspec tests used to have a before each that looked like this:

 @driver = HAmvc::Configuration.instance.get_driver :ios
 @welcome = @driver
 @signin = @driver
 @menu = @driver

The controllers would be constructed like this

def initialize browser
 @view = browser

Now the before all looks like this:

 @welcome =
 @signin =
 @menu =

And the the controller does this

 def initialize view =
   @view = view

The view class now knows how to get a driver from the singleton that has them. So the an environment variable set to ios_stage would load up the center chunk of this:

 :env: stage
 :os: android
 :artifact: http://jenkins-machine/job/android-stage-build/lastSuccessfulBuild/artifact/HomeAway-app/build/apk/HomeAway-app-release.apk
 :locale: en_US
 :env: stage
 :os: ios
 :artifact: http://jenkins-machine/job/HomeAway-iOS/DEPLOY_ENV=Stage/lastSuccessfulBuild/artifact/artifacts/homeaway-internal-STAGE.ipa
 :locale: en_US
 :env: stage
 :os: ios
 :artifact: /Users/blavelle/
 :locale: en_US

I’m much happier with this setup but now the question is, how do I iterate over configurations? ¬†Should I do it within a ruby or have a different Jenkins job for each configuration in that yaml file?