Method: Cnvrg::Commands::Flow#run

Defined in:
lib/cnvrg/cli/flow.rb

#run(path) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/cnvrg/cli/flow.rb', line 38

def run(path)
  unless @curr_dir.present?
    @cli.log_message("Cant run this command because you are not in project directory", Thor::Color::RED)
    return false
  end
  begin
    path = "#{path}.flow.yaml" unless path.end_with? '.flow.yaml'
    @flow = Cnvrg::Flows.new(@curr_dir, path)
    url = @flow.run
  rescue => e
    @cli.log_message("Cant run the flow, please run 'cnvrg flow verify #{path}' to check it", Thor::Color::RED)
    @cli.log_error(e)
    return
  end
  check = Cnvrg::Helpers.checkmark
  @cli.log_message("#{check} The flow is running, you can track the status in: #{url}", Thor::Color::GREEN)
  true
end