reduced restrictions on tasks to gracefully handle non-configured setups
This commit is contained in:
parent
bf9f918052
commit
951607cade
@ -65,8 +65,6 @@ module Hydra #:nodoc:
|
|||||||
if @config
|
if @config
|
||||||
@opts.merge!(:config => @config)
|
@opts.merge!(:config => @config)
|
||||||
else
|
else
|
||||||
$stderr.write "Hydra: No configuration file found at 'hydra.yml' or 'config/hydra.yml'\n"
|
|
||||||
$stderr.write "Hydra: Using default configuration for a single-core machine\n"
|
|
||||||
@opts.merge!(:workers => [{:type => :local, :runners => 1}])
|
@opts.merge!(:workers => [{:type => :local, :runners => 1}])
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -99,13 +97,11 @@ module Hydra #:nodoc:
|
|||||||
@name = name
|
@name = name
|
||||||
yield self if block_given?
|
yield self if block_given?
|
||||||
@config = find_config_file
|
@config = find_config_file
|
||||||
|
if @config
|
||||||
unless @config
|
|
||||||
$stderr.write "No config file. Can't run a remote task without remote workers\n"
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
define
|
define
|
||||||
|
else
|
||||||
|
task "hydra:remote:#{@name}" do ; end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -115,7 +111,6 @@ module Hydra #:nodoc:
|
|||||||
config = YAML.load_file(@config)
|
config = YAML.load_file(@config)
|
||||||
workers = config.fetch('workers') { [] }
|
workers = config.fetch('workers') { [] }
|
||||||
workers = workers.select{|w| w['type'] == 'ssh'}
|
workers = workers.select{|w| w['type'] == 'ssh'}
|
||||||
raise "No remote workers" if workers.empty?
|
|
||||||
workers.each do |worker|
|
workers.each do |worker|
|
||||||
$stdout.write "==== Hydra Running #{@name} on #{worker['connect']} ====\n"
|
$stdout.write "==== Hydra Running #{@name} on #{worker['connect']} ====\n"
|
||||||
ssh_opts = worker.fetch('ssh_opts') { '' }
|
ssh_opts = worker.fetch('ssh_opts') { '' }
|
||||||
|
Loading…
Reference in New Issue
Block a user