dory 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dory/docker_service.rb +26 -15
- data/lib/dory/resolv.rb +0 -8
- data/lib/dory/version.rb +2 -2
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53c6457eeee8b8c77ee2373629fec053be1a38af
|
4
|
+
data.tar.gz: c58d1b2cc83521c5c708b7e3acaa6039fb201687
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f9ce5a80dcc586ff1e274537ad6b92aa8ca8b70280d64ee16e03111dcd7bfed107b87c6ca25e1db75a2f623ac91ccb5af7687c48923cbcf55a9670adbea6265
|
7
|
+
data.tar.gz: 49bb7575f2d686660a5b0d9affa7d05e1c1b312097bf6a1ab3013674ce5ba1761bda705148e040a2913c2854a9b4b6ae724ddbf9e3f80722200814f950925632
|
data/lib/dory/docker_service.rb
CHANGED
@@ -2,6 +2,10 @@ require 'shellwords'
|
|
2
2
|
|
3
3
|
module Dory
|
4
4
|
module DockerService
|
5
|
+
def docker_installed?
|
6
|
+
Sh.run_command('which docker').success?
|
7
|
+
end
|
8
|
+
|
5
9
|
def run_preconditions
|
6
10
|
# Override if preconditions are needed
|
7
11
|
return true
|
@@ -18,28 +22,35 @@ module Dory
|
|
18
22
|
puts "[DEBUG] Container '#{self.container_name}' is already running. Doing nothing"
|
19
23
|
end
|
20
24
|
else
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"Failed to
|
35
|
-
|
25
|
+
if docker_installed?
|
26
|
+
self.run_preconditions
|
27
|
+
if self.container_exists?
|
28
|
+
puts "[DEBUG] Container '#{self.container_name}' exists. Deleting" if Dory::Config.debug?
|
29
|
+
self.delete
|
30
|
+
end
|
31
|
+
if Dory::Config.debug?
|
32
|
+
puts "[DEBUG] '#{self.container_name}' does not exist. Creating/starting " \
|
33
|
+
"'#{self.container_name}' with '#{self.run_command}'"
|
34
|
+
end
|
35
|
+
status = Sh.run_command(self.run_command)
|
36
|
+
unless status.success?
|
37
|
+
if !handle_error || !self.handle_error(status)
|
38
|
+
puts "Failed to start docker container '#{self.container_name}' " \
|
39
|
+
". Command '#{self.run_command}' failed".red
|
40
|
+
end
|
36
41
|
end
|
42
|
+
else
|
43
|
+
err_msg = "Docker does not appear to be installed /o\\\n" \
|
44
|
+
"Docker is required for DNS and Nginx proxy. These can be " \
|
45
|
+
"disabled in the config file if you don't need them."
|
46
|
+
puts err_msg.red
|
37
47
|
end
|
38
48
|
end
|
39
49
|
self.running?
|
40
50
|
end
|
41
51
|
|
42
52
|
def running?(container_name = self.container_name)
|
53
|
+
return false unless docker_installed?
|
43
54
|
!!(self.ps =~ /#{container_name}/)
|
44
55
|
end
|
45
56
|
|
data/lib/dory/resolv.rb
CHANGED
@@ -7,14 +7,6 @@ module Dory
|
|
7
7
|
Dory::Resolv::Linux
|
8
8
|
end
|
9
9
|
|
10
|
-
# def self.method_missing(method_sym, *arguments, &block)
|
11
|
-
# self.get_module.send(method_sym, arguments, &block)
|
12
|
-
# end
|
13
|
-
|
14
|
-
# def self.respond_to?(method_sym, include_private = false)
|
15
|
-
# self.get_module.respond_to?(method_sym, include_private)
|
16
|
-
# end
|
17
|
-
|
18
10
|
def self.has_our_nameserver?
|
19
11
|
self.get_module.has_our_nameserver?
|
20
12
|
end
|
data/lib/dory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Porter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -174,4 +174,3 @@ specification_version: 4
|
|
174
174
|
summary: slackbot_frd provides a dirt-simple framework for implementing one or more
|
175
175
|
slack bots
|
176
176
|
test_files: []
|
177
|
-
has_rdoc:
|