Sha256: 1a757927c0e6dcd654494687bf34f989a27d5dd941aaa1ef32fed80033645e01
Contents?: true
Size: 1.13 KB
Versions: 6
Compression:
Stored size: 1.13 KB
Contents
require 'dplyr/stages_config' require 'dplyr/task_runner' require 'dply/logger' module Dplyr class Cli include ::Dply::Logger attr_reader :stage, :argv def initialize(stage, argv) @stage = stage @argv = argv end def run global_switches = [] global_switches << "--debug" if logger.debug? case stage when 'dev' global_switches << "--no-config" system "drake #{global_switches.join(" ")} #{argv_str}" when 'local' system "drake #{global_switches.join(" ")} #{argv_str}" else run_remote_task end end def stage_data @stage_data ||= StagesConfig.new.fetch(@stage).data end def hosts stage_data[:hosts] end def parallel_jobs stage_data[:parallel_runs] end def env_str str = "" stage_data[:env].each do |k,v| str << %(DPLY_#{k.upcase}="#{v}" ) end str end def argv_str @argv_str ||= argv.join(' ') end def run_remote_task task_runner = TaskRunner.new(hosts, argv_str, parallel_jobs: parallel_jobs) task_runner.run end end end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
dply-0.2.3 | lib/dplyr/cli.rb |
dply-0.2.2 | lib/dplyr/cli.rb |
dply-0.2.0 | lib/dplyr/cli.rb |
dply-0.1.19 | lib/dplyr/cli.rb |
dply-0.1.18 | lib/dplyr/cli.rb |
dply-0.1.17 | lib/dplyr/cli.rb |