invoker 1.5.3 → 1.5.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/Rakefile +2 -1
- data/lib/invoker.rb +2 -1
- data/lib/invoker/cli.rb +14 -1
- data/lib/invoker/command_worker.rb +5 -1
- data/lib/invoker/commander.rb +8 -2
- data/lib/invoker/process_printer.rb +16 -0
- data/lib/invoker/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 174f97bf4ba760cca1391b8c904114e7949c9dbd
|
4
|
+
data.tar.gz: 3fc440a77808ed5fe86f4b344f015f6c866a52b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58a73394506ed9427f8637c46794643a37c1de4517a48786310e36f5f89f2a9f71c8c8ce6d157cc2798af6a9e2d78262d1362cabaf5f6378e827cbaeae20910c
|
7
|
+
data.tar.gz: ce5a29570d59711eee4683533bfdc6668581ff23908abd53dc6e71279551b7679856838269bb02d4ce190f929ff02a08ce87fb17efd6aa6bb27a2b7cb0585307
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
## Changelog since 1.5.4
|
2
|
+
|
3
|
+
|
4
|
+
# v1.5.4
|
5
|
+
* Add support for running Invoker build in SELinux environments (https://github.com/code-mancers/invoker/pull/188)
|
6
|
+
* Add an option to print process listing in raw format. This enables us to see complete process list (https://github.com/code-mancers/invoker/pull/193)
|
7
|
+
* Fix colors in console output (https://github.com/code-mancers/invoker/pull/192)
|
8
|
+
* Add a new option to optionally disable colors in log when starting invoker (#196)
|
9
|
+
* Handle TERM and INT signals when stopping invoker. (#196)
|
10
|
+
|
11
|
+
## v1.5.3
|
12
|
+
|
13
|
+
* Always capture STDOUT/STDERR of process to invoker's log file, if invoker is daemonized. (https://github.com/code-mancers/invoker/pull/186)
|
14
|
+
* Add a command for filtering all logs for a process. (https://github.com/code-mancers/invoker/pull/186)
|
15
|
+
* Prefer Procfile.dev to Procfile (https://github.com/code-mancers/invoker/pull/183)
|
16
|
+
* Downgrade Rainbow version to prevent compilation errors in certain environments (https://github.com/code-mancers/invoker/pull/180)
|
17
|
+
* Non existant PWD environment variable may cause errors while starting a process (https://github.com/code-mancers/invoker/pull/179)
|
18
|
+
* Implement support for specifying process ordering. This allows user to be explicit about
|
19
|
+
order in which Invoker should start processes from ini file (https://github.com/code-mancers/invoker/pull/174)
|
20
|
+
* Return correct version of Invoker in HTTP header (https://github.com/code-mancers/invoker/pull/173)
|
data/Rakefile
CHANGED
@@ -11,5 +11,6 @@ current_directory = File.expand_path(File.dirname(__FILE__))
|
|
11
11
|
desc "run specs inside docker"
|
12
12
|
task :docker_spec do
|
13
13
|
system("docker build -t invoker-ruby . ")
|
14
|
-
|
14
|
+
puts "********** Building image is done **********"
|
15
|
+
system("docker run --name invoker-rspec --rm -v #{current_directory}:/invoker:z -t invoker-ruby")
|
15
16
|
end
|
data/lib/invoker.rb
CHANGED
@@ -36,9 +36,10 @@ require "invoker/process_printer"
|
|
36
36
|
module Invoker
|
37
37
|
class << self
|
38
38
|
attr_accessor :config, :tail_watchers, :commander
|
39
|
-
attr_accessor :dns_cache, :daemonize
|
39
|
+
attr_accessor :dns_cache, :daemonize, :nocolors
|
40
40
|
|
41
41
|
alias_method :daemonize?, :daemonize
|
42
|
+
alias_method :nocolors?, :nocolors
|
42
43
|
|
43
44
|
def darwin?
|
44
45
|
ruby_platform.downcase.include?("darwin")
|
data/lib/invoker/cli.rb
CHANGED
@@ -37,10 +37,15 @@ module Invoker
|
|
37
37
|
type: :boolean,
|
38
38
|
banner: "Daemonize the server into the background",
|
39
39
|
aliases: [:d]
|
40
|
+
option :nocolors,
|
41
|
+
type: :boolean,
|
42
|
+
banner: "Disable color in output",
|
43
|
+
aliases: [:nc]
|
40
44
|
def start(file = nil)
|
41
45
|
Invoker.setup_config_location
|
42
46
|
port = options[:port] || 9000
|
43
47
|
Invoker.daemonize = options[:daemon]
|
48
|
+
Invoker.nocolors = options[:nocolors]
|
44
49
|
Invoker.load_invoker_config(file, port)
|
45
50
|
warn_about_notification
|
46
51
|
warn_about_old_configuration
|
@@ -80,9 +85,17 @@ module Invoker
|
|
80
85
|
end
|
81
86
|
|
82
87
|
desc "list", "List all running processes"
|
88
|
+
option :raw,
|
89
|
+
type: :boolean,
|
90
|
+
banner: "Print process list in raw text format",
|
91
|
+
aliases: [:r]
|
83
92
|
def list
|
84
93
|
unix_socket.send_command('list') do |response_object|
|
85
|
-
|
94
|
+
if options[:raw]
|
95
|
+
Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_raw_text }
|
96
|
+
else
|
97
|
+
Invoker::ProcessPrinter.new(response_object).tap { |printer| printer.print_table }
|
98
|
+
end
|
86
99
|
end
|
87
100
|
end
|
88
101
|
|
@@ -27,7 +27,11 @@ module Invoker
|
|
27
27
|
tail_watchers = Invoker.tail_watchers[@command_label]
|
28
28
|
color_line = "#{@command_label.color(color)} : #{line}"
|
29
29
|
plain_line = "#{@command_label} : #{line}"
|
30
|
-
Invoker
|
30
|
+
if Invoker.nocolors?
|
31
|
+
Invoker::Logger.puts plain_line
|
32
|
+
else
|
33
|
+
Invoker::Logger.puts color_line
|
34
|
+
end
|
31
35
|
if tail_watchers && !tail_watchers.empty?
|
32
36
|
json_encoded_tail_response = tail_response(color_line)
|
33
37
|
if json_encoded_tail_response
|
data/lib/invoker/commander.rb
CHANGED
@@ -82,10 +82,16 @@ module Invoker
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def install_interrupt_handler
|
85
|
-
Signal.trap("INT")
|
85
|
+
Signal.trap("INT") {
|
86
|
+
Invoker::Logger.puts("Stopping invoker")
|
86
87
|
process_manager.kill_workers
|
87
88
|
exit(0)
|
88
|
-
|
89
|
+
}
|
90
|
+
Signal.trap("TERM") {
|
91
|
+
Invoker::Logger.puts("Stopping invoker")
|
92
|
+
process_manager.kill_workers
|
93
|
+
exit(0)
|
94
|
+
}
|
89
95
|
end
|
90
96
|
|
91
97
|
def daemonize_app
|
@@ -19,6 +19,22 @@ module Invoker
|
|
19
19
|
Formatador.display_compact_table(hash_with_colors)
|
20
20
|
end
|
21
21
|
|
22
|
+
def print_raw_text
|
23
|
+
list_response.processes.each do |process|
|
24
|
+
Formatador.display_line("[bold]Process Name : #{process.process_name}[/]")
|
25
|
+
Formatador.indent {
|
26
|
+
Formatador.display_line("Dir : #{process.dir}")
|
27
|
+
if process.pid
|
28
|
+
Formatador.display_line("PID : #{process.pid}")
|
29
|
+
else
|
30
|
+
Formatador.display_line("PID : Not Running")
|
31
|
+
end
|
32
|
+
Formatador.display_line("Port : #{process.port}")
|
33
|
+
Formatador.display_line("Command : #{process.shell_command}")
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
22
38
|
private
|
23
39
|
|
24
40
|
def colorize_hash(process, color)
|
data/lib/invoker/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hemant Kumar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- ".rspec"
|
234
234
|
- ".rubocop.yml"
|
235
235
|
- ".travis.yml"
|
236
|
+
- CHANGELOG.md
|
236
237
|
- Dockerfile
|
237
238
|
- Gemfile
|
238
239
|
- MIT-LICENSE
|