Module: Polyrun::Hooks::WorkerRunner
- Defined in:
- lib/polyrun/hooks/worker_runner.rb
Overview
Invoked by worker shell wrapper (+ruby -e+). Requires POLYRUN_HOOKS_RUBY_FILE.
Class Method Summary collapse
-
.run!(phase) ⇒ Integer
Exit code (0 on success).
Class Method Details
.run!(phase) ⇒ Integer
Returns exit code (0 on success).
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/polyrun/hooks/worker_runner.rb', line 10 def run!(phase) phase = phase.to_sym path = ENV["POLYRUN_HOOKS_RUBY_FILE"] return 0 if path.nil? || path.empty? registry = Dsl.load_registry(path) return 0 if registry.nil? || !registry.any?(phase) env = ENV.to_h registry.run(phase, env) 0 rescue => e Polyrun::Log.warn "polyrun hooks worker #{phase}: #{e.class}: #{e.}" 1 end |