lib/deploy-context/context/deploy.rb in deploy-context-1.0.0 vs lib/deploy-context/context/deploy.rb in deploy-context-2.0.0.1.gae09dc8

- old
+ new

@@ -31,36 +31,49 @@ def cucumber(commands = []) chef_exec(['cucumber'] + commands) end def execute_action(context, action) - if action.nil? + state_action = if action.nil? context.cycle + false else case action when 'once' puts "\nExecute only once\n" context.cycle + false when 'always' puts "\nAlways in execution\n" while true do context.cycle end + false when 'bump' puts "\nBump minor version\n" context.minor_bump + false when 'release' puts "\nBump major version\n" context.major_bump + false when 'test' puts "\nExecute tests\n" - context.cucumber_test(deployer) + context.cucumber_test(context) + false when 'reset' puts "\nReset versionning\n" # context.cucumber_test(deployer) + false else puts "Unknown setting #{action}" + false end + end + if state_action + puts "Action #{action} executed correctly in context #{context}" + else + abort!("Failed to execute action #{action} in context #{context}") end end end end \ No newline at end of file