task-orchestrator 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/orchestrator/task.rb +9 -4
- data/lib/orchestrator/version.rb +1 -1
- metadata +9 -9
data/lib/orchestrator/task.rb
CHANGED
@@ -22,12 +22,12 @@ module Orchestrator
|
|
22
22
|
@defaults[:envs] = Object.new
|
23
23
|
@defaults[:args] = Object.new
|
24
24
|
|
25
|
-
|
25
|
+
bail("config file #{config} does not exists") unless File.exist?(@options.config)
|
26
26
|
|
27
27
|
@settings = YAML.load_file(@options.config)
|
28
|
-
|
28
|
+
bail("no task job #{@options.name} is defined in settings file") unless @settings['orchestrator'].has_key?(@options.name)
|
29
29
|
|
30
|
-
|
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
|
-
|
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
|
data/lib/orchestrator/version.rb
CHANGED
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.
|
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-
|
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/
|
93
|
+
- examples/multistep
|
98
94
|
- examples/parallel
|
95
|
+
- examples/interpolation
|
96
|
+
- examples/timeouts
|
99
97
|
- examples/flock
|
100
|
-
- examples/
|
98
|
+
- examples/loops
|
99
|
+
- examples/conditionals
|
100
|
+
- examples/dependencies
|
101
101
|
- task-orchestrator.gemspec
|
102
102
|
- LICENSE
|
103
103
|
- README.md
|