Class: Floe::CLI
- Inherits:
-
Object
- Object
- Floe::CLI
- Includes:
- Logging
- Defined in:
- lib/floe/cli.rb,
lib/floe/cli/logger.rb
Defined Under Namespace
Classes: Logger
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run(args = ARGV) ⇒ Object
Methods included from Logging
Constructor Details
Instance Method Details
#run(args = ARGV) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/floe/cli.rb', line 16 def run(args = ARGV) workflows_inputs, opts = (args) show_execution_id = workflows_inputs.size > 1 credentials = create_credentials(opts) workflows = workflows_inputs.map do |workflow, input| wf_logger = create_logger(show_execution_id) create_workflow(workflow, opts[:context], input, credentials, wf_logger) end logger.info("Checking #{workflows.count} workflows...") ready = Floe::Workflow.wait(workflows, &:run_nonblock) logger.info("Checking #{workflows.count} workflows...Complete - #{ready.count} ready") # Display status workflows.each do |workflow| logger.info("[#{workflow.context.execution_id}] #{workflow.name} (#{workflow.status}) - output: #{workflow.output}") end workflows.all? { |workflow| workflow.context.success? } rescue Floe::Error => err abort(err.) end |