libraries/deploy-context/deploy/deployer.rb in deploy-context-2.1.35.3.g2abab85.16.g399fb24.9.g1523b69.8.ga24e5ef vs libraries/deploy-context/deploy/deployer.rb in deploy-context-2.1.37.6.gec1e116

- old
+ new

@@ -11,21 +11,35 @@ def contexts_container(context) context.get_context_file(context, 'contexts') end + def show_help(context) + help_message = <<MESSAGE_END +Use not option or the option 'cycle' to cycle through the deployer once +Use the option 'agent' to made a continual loop of the cycle +Use the option 'bump' to bump the patch version +Use the option 'release' to bump the minor version +Use the option 'upgrade' to bump the major version +Use the option 'test' to test the context +Use the option 'reset' to execute the local cycle once +Use the option 'help' to show this message +MESSAGE_END + context.error_log(context, help_message) + end + def execute_action(context, action) state_action = if action.nil? - context.cycle + show_help(context) false else case action - when 'once' - context.log "\nExecute only once\n" + when 'cycle' + context.log "\nExecute only the cycle once\n" context.cycle true - when 'always' + when 'agent' context.log "\nAlways in execution\n" while true do context.cycle end true @@ -47,11 +61,15 @@ when 'reset' context.log "\nReset versionning\n" system('rake') # context.cucumber_test(deployer) true + when 'help' + context.show_help(context) + true else context.error_log context.context_name, "Unknown setting #{action}" + show_help(context) false end end context.commit if state_action