Sha256: fcd693189bf0da2accc87bc6f495856bdab4294813bb35045e322984e3a2a690

Contents?: true

Size: 1.23 KB

Versions: 68

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/env ruby

require 'optparse'

options = { foreman_root: Dir.pwd }

opts = OptionParser.new do |opts|
  opts.banner = <<BANNER
Run Dynflow executor for Foreman tasks.

Usage: #{File.basename($0)} [options] ACTION"

ACTION can be one of:

  * start   - start the executor on background. It creates these files
              in tmp/pid directory:

                * dynflow_executor_monitor.pid - pid of monitor ensuring
                                                 the executor keeps running
                * dynflow_executor.pid         - pid of the executor itself
                * dynflow_executor.output      - stdout of the executor
  * stop    - stops the running executor
  * restart - restarts the running executor
  * run     - run the executor in foreground

BANNER

  opts.on('-h', '--help', 'Show this message') do
    puts opts
    exit 1
  end
  opts.on('-f', '--foreman-root=PATH', "Path to Foreman Rails root path. By default '#{options[:foreman_root]}'") do |path|
    options[:foreman_root] = path
  end
end

args = opts.parse!(ARGV)
command = args.first || 'run'

app_file = File.expand_path('./config/application', options[:foreman_root])
require app_file

ForemanTasks::Dynflow::Daemon.new.run_background(command, options)

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
foreman-tasks-0.8.5 bin/dynflow-executor
foreman-tasks-0.8.4 bin/dynflow-executor
foreman-tasks-0.8.3 bin/dynflow-executor
foreman-tasks-0.8.2 bin/dynflow-executor
foreman-tasks-0.8.1 bin/dynflow-executor
foreman-tasks-0.8.0 bin/dynflow-executor
foreman-tasks-0.7.20 bin/dynflow-executor
foreman-tasks-0.7.19 bin/dynflow-executor
foreman-tasks-0.7.18 bin/dynflow-executor
foreman-tasks-0.7.17 bin/dynflow-executor
foreman-tasks-0.7.16 bin/dynflow-executor
foreman-tasks-0.7.15 bin/dynflow-executor
foreman-tasks-0.7.14 bin/dynflow-executor
foreman-tasks-0.7.13 bin/dynflow-executor
foreman-tasks-0.7.12 bin/dynflow-executor
foreman-tasks-0.7.11 bin/dynflow-executor
foreman-tasks-0.7.10 bin/dynflow-executor
foreman-tasks-0.7.9 bin/dynflow-executor
foreman-tasks-0.7.8 bin/dynflow-executor
foreman-tasks-0.7.7 bin/dynflow-executor