task-orchestrator 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,12 +22,12 @@ module Orchestrator
22
22
  @defaults[:envs] = Object.new
23
23
  @defaults[:args] = Object.new
24
24
 
25
- invalid("config file #{config} does not exists") unless File.exist?(@options.config)
25
+ bail("config file #{config} does not exists") unless File.exist?(@options.config)
26
26
 
27
27
  @settings = YAML.load_file(@options.config)
28
- invalid("no task job #{@options.name} is defined in settings file") unless @settings['orchestrator'].has_key?(@options.name)
28
+ bail("no task job #{@options.name} is defined in settings file") unless @settings['orchestrator'].has_key?(@options.name)
29
29
 
30
- invalid("no statedir is defined in settings file") if @settings['orchestrator'][@options.name]['save'] && !@settings['orchestrator'].has_key?('statedir')
30
+ bail("no statedir is defined in settings file") if @settings['orchestrator'][@options.name]['save'] && !@settings['orchestrator'].has_key?('statedir')
31
31
  unless @options.statefile
32
32
  if @settings['orchestrator'][@options.name]['save']
33
33
  @options.statefile = @settings['orchestrator']['statedir'] + "/" + @options.name
@@ -54,7 +54,7 @@ module Orchestrator
54
54
  end
55
55
  unless @got_lock
56
56
  unless @options.wait
57
- invalid("The state file #{@options.statefile} is already locked by other process")
57
+ bail("The state file #{@options.statefile} is already locked by other process")
58
58
  else
59
59
  Formatador.display_line("[yellow]WARN[/]: Blocking until already running process ends")
60
60
  File.open(@options.statefile, "r") do |file|
@@ -108,6 +108,11 @@ module Orchestrator
108
108
  @options.sms_on_success = (@options.sms and @state['sms'].has_key?('on_success')) ? @state['sms']['on_success'] : false
109
109
  end
110
110
 
111
+ def bail(reason)
112
+ Formatador.display_line("[red]ERROR[/]: #{reason}")
113
+ exit 1
114
+ end
115
+
111
116
  def invalid(reason)
112
117
  Formatador.display_line("[red]ERROR[/]: #{reason}")
113
118
  FileUtils.rm_f(@options.statefile) if @options.statefile
@@ -1,3 +1,3 @@
1
1
  module Orchestrator
2
- VERSION ||= '0.0.17'
2
+ VERSION ||= '0.0.18'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: task-orchestrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-10 00:00:00.000000000 Z
12
+ date: 2014-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pony
@@ -85,19 +85,19 @@ extra_rdoc_files: []
85
85
  files:
86
86
  - bin/orchestrator
87
87
  - lib/orchestrator.rb
88
+ - lib/orchestrator/task.rb
88
89
  - lib/orchestrator/version.rb
89
90
  - lib/orchestrator/cli.rb
90
- - lib/orchestrator/task.rb
91
- - examples/timeouts
92
- - examples/conditionals
93
- - examples/interpolation
94
- - examples/dependencies
95
91
  - examples/sequential
96
92
  - examples/failure_handler
97
- - examples/loops
93
+ - examples/multistep
98
94
  - examples/parallel
95
+ - examples/interpolation
96
+ - examples/timeouts
99
97
  - examples/flock
100
- - examples/multistep
98
+ - examples/loops
99
+ - examples/conditionals
100
+ - examples/dependencies
101
101
  - task-orchestrator.gemspec
102
102
  - LICENSE
103
103
  - README.md