Class: Kuroko2::Workflow::Task::Execute
- Inherits:
-
Base
- Object
- Base
- Kuroko2::Workflow::Task::Execute
show all
- Defined in:
- lib/autoload/kuroko2/workflow/task/execute.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#before_execute ⇒ Object
24
25
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 24
def before_execute
end
|
#chdir ⇒ Object
27
28
29
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 27
def chdir
nil
end
|
#execute ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 5
def execute
if (execution = Execution.of(token).take)
update_execution(execution)
else
validate
token.context['CHDIR'] = chdir
before_execute
Execution.create!(token: token,
job_definition: token.job_definition,
job_instance: token.job_instance,
shell: shell,
queue: token.context['QUEUE'] || Execution::DEFAULT_QUEUE,
context: token.context)
:pass
end
end
|
#shell ⇒ Object
31
32
33
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 31
def shell
option
end
|
#validate ⇒ Object
35
36
37
38
39
|
# File 'lib/autoload/kuroko2/workflow/task/execute.rb', line 35
def validate
if option.blank?
raise Workflow::AssertionError, "Option is required for execute"
end
end
|