I moved my config into yaml files

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

 @driver = HAmvc::Configuration.instance.get_driver :ios
 @welcome = MobileTest::Welcome_controller.new @driver
 @signin = MobileTest::SignInController.new @driver
 @menu = MobileTest::MenuController.new @driver

The controllers would be constructed like this

def initialize browser
 @view = SignIn_view.new browser

Now the before all looks like this:

 @welcome = MobileTest::Welcome_controller.new
 @signin = MobileTest::SignInController.new
 @menu = MobileTest::MenuController.new

And the the controller does this

 def initialize view = SignIn_view.new
   @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/iOS.app
 :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?

Explore posts in the same categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: