grid_runner 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Procfile +1 -0
- data/README.md +6 -0
- data/bin/grid_runner +42 -7
- data/lib/grid_runner/applications.rb +4 -2
- data/lib/grid_runner/version.rb +1 -1
- metadata +2 -6
- data/grid_runner-0.0.1.gem +0 -0
- data/grid_runner-0.0.3.gem +0 -0
- data/grid_runner-0.0.5.gem +0 -0
- data/grid_runner-0.0.6.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70f55992a0c7bb4a0eb739a733a68bf23ed55496
|
4
|
+
data.tar.gz: 9334a9feb173442082d07d9f9b529b4f0aded3dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc7ca09a106100893859400c5cacbac7d91ff8d9ea801158c2bcf6cae163df17961d10af84b3cc8f3dc8b97ecf9e40a76fc470814ba7a5856642d1966350a5f8
|
7
|
+
data.tar.gz: 931d1ca6329f0ad4dc732ed97dea3a3c3a7ef20b82e09ad6ccff71b3ffca9da6658647932a7f1fdcea25c86e99a0eaa941b56f2812e39c6e5963e3d1893cbb6f
|
data/Gemfile.lock
CHANGED
data/Procfile
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,13 @@ Commands
|
|
22
22
|
* ``` grid_runner run <APP_NAME || 'all' > ```
|
23
23
|
* ``` grid_runner kill <APP_NAME || 'all' > ```
|
24
24
|
* ``` grid_runner restart <APP_NAME || 'all' > ```
|
25
|
+
* ``` grid_runner running ```
|
26
|
+
* ``` grid_runner not_running ```
|
25
27
|
|
28
|
+
All commands that take an app name can take a space delimited list of app names:
|
29
|
+
|
30
|
+
e.g.
|
31
|
+
``` gr log media-api cropper thrall ```
|
26
32
|
|
27
33
|
Logs
|
28
34
|
----
|
data/bin/grid_runner
CHANGED
@@ -13,19 +13,54 @@ arguments :strict
|
|
13
13
|
|
14
14
|
def apps_from_args(args)
|
15
15
|
return App.all if args.first == "all"
|
16
|
-
return App.find(args)
|
16
|
+
return App.find(args) unless args.empty?
|
17
17
|
end
|
18
18
|
|
19
|
+
desc 'lists apps that are running'
|
20
|
+
command :running do |c|
|
21
|
+
c.action do |global_options,options,args|
|
22
|
+
running_apps = App.all.select { |a| a.status == :running}
|
23
|
+
if running_apps.empty?
|
24
|
+
puts Rainbow("No apps running").red
|
25
|
+
else
|
26
|
+
puts Rainbow("Running apps:").blue
|
27
|
+
puts Rainbow("#{running_apps.map(&:name)}").green
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
desc 'lists apps that are not running'
|
34
|
+
command :not_running do |c|
|
35
|
+
c.action do |global_options,options,args|
|
36
|
+
not_running = App.all.reject { |a| a.status == :running}
|
37
|
+
puts Rainbow("All apps running").red and return if not_running.empty?
|
38
|
+
if not_running.empty?
|
39
|
+
puts Rainbow("All apps running").red
|
40
|
+
else
|
41
|
+
puts Rainbow("Not running:").red.underline.bright
|
42
|
+
puts Rainbow("#{not_running.map(&:name).join(", ")}").red
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
|
19
49
|
desc 'runs a given app listed in the Procfile (or all)'
|
20
50
|
arg_name "app names separated by a SPACE or 'all'"
|
21
51
|
command :run do |c|
|
22
52
|
c.action do |global_options,options,args|
|
23
|
-
apps_from_args(args)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
app.
|
53
|
+
apps_to_run = apps_from_args(args)
|
54
|
+
if apps_to_run.empty?
|
55
|
+
Rainbow("No app #{args.first} found in Procfile")
|
56
|
+
else
|
57
|
+
apps_to_run.each do |app|
|
58
|
+
if app.status == :running
|
59
|
+
puts Rainbow("#{app.name} already running!").red
|
60
|
+
puts
|
61
|
+
else
|
62
|
+
app.run
|
63
|
+
end
|
29
64
|
end
|
30
65
|
end
|
31
66
|
end
|
@@ -39,7 +39,6 @@ class App
|
|
39
39
|
puts "status: #{status}"
|
40
40
|
puts "pid: #{pid}" if status == :running
|
41
41
|
puts "log: #{log.path}"
|
42
|
-
puts
|
43
42
|
end
|
44
43
|
|
45
44
|
def kill!
|
@@ -52,7 +51,7 @@ class App
|
|
52
51
|
end
|
53
52
|
|
54
53
|
def log
|
55
|
-
File.open((Dir.pwd + "/logs/" + "#{name}.log"), "
|
54
|
+
File.open((Dir.pwd + "/logs/" + "#{name}.log"), "ab")
|
56
55
|
end
|
57
56
|
|
58
57
|
def run
|
@@ -77,6 +76,9 @@ class App
|
|
77
76
|
stdout.split(/\n/).find do |l|
|
78
77
|
l.match(name) &&
|
79
78
|
!l.match("grep") &&
|
79
|
+
!l.match("tail") &&
|
80
|
+
# for auth
|
81
|
+
!l.match("MacOS") &&
|
80
82
|
!l.match("grid_runner")
|
81
83
|
end
|
82
84
|
end
|
data/lib/grid_runner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grid_runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NickyPStraightStylinOnEm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -79,10 +79,6 @@ files:
|
|
79
79
|
- README.md
|
80
80
|
- Rakefile
|
81
81
|
- bin/grid_runner
|
82
|
-
- grid_runner-0.0.1.gem
|
83
|
-
- grid_runner-0.0.3.gem
|
84
|
-
- grid_runner-0.0.5.gem
|
85
|
-
- grid_runner-0.0.6.gem
|
86
82
|
- grid_runner.gemspec
|
87
83
|
- grid_runner.rdoc
|
88
84
|
- lib/grid_runner.rb
|
data/grid_runner-0.0.1.gem
DELETED
Binary file
|
data/grid_runner-0.0.3.gem
DELETED
Binary file
|
data/grid_runner-0.0.5.gem
DELETED
Binary file
|
data/grid_runner-0.0.6.gem
DELETED
Binary file
|