docker_core 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docker_core.rb +21 -18
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3462495808e195a26c503fcb47e809cd1cf3b14234785f54906da57c1312fadd
|
4
|
+
data.tar.gz: ca4e5679e8ea61bd243355a9b4ad68258d7da68086d51356e6105df10f51d206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bc578621035135247e128d111ff55393725de6b3f237bc2c6d3eb7af2e8e8f36b8382461a3005a02ab4aa4f25a8a59cc98c6185e7453215c12a3573bfae2bf9
|
7
|
+
data.tar.gz: e28f011b67bcee8e3fac989191b8d727c5abadb6d58793f0a166fa75f4ffd2e29fc0552103bdb6f67e87fc4267aaa0431959db7ad8a075bbe09a91c0db7bc007
|
data/lib/docker_core.rb
CHANGED
@@ -40,6 +40,9 @@ module DockerCore
|
|
40
40
|
module Image
|
41
41
|
end
|
42
42
|
|
43
|
+
module Orchestrator
|
44
|
+
end
|
45
|
+
|
43
46
|
module Command
|
44
47
|
end
|
45
48
|
|
@@ -48,8 +51,8 @@ module DockerCore
|
|
48
51
|
# @param [String] registry
|
49
52
|
# @param [String] namespace
|
50
53
|
# @param [String] tag
|
51
|
-
def self.
|
52
|
-
return
|
54
|
+
def self.from_image(image, registry: REGISTRY, namespace: NAMESPACE, tag: 'latest')
|
55
|
+
return "#{registry}/#{namespace}/#{image}:#{tag}"
|
53
56
|
end
|
54
57
|
|
55
58
|
def self.deploy_path
|
@@ -74,7 +77,7 @@ module DockerCore
|
|
74
77
|
return { docker: Shell.is_active_unit('docker') }
|
75
78
|
end
|
76
79
|
|
77
|
-
def self.
|
80
|
+
def self.detect_orchestrator
|
78
81
|
swarm = self.read_swarm.to_sym
|
79
82
|
detect = self.detect_services
|
80
83
|
|
@@ -88,9 +91,7 @@ module DockerCore
|
|
88
91
|
|
89
92
|
def self.swarm_status
|
90
93
|
color = Color::GREEN
|
91
|
-
|
92
|
-
|
93
|
-
Color.echo("Swarm: #{detect}", color)
|
94
|
+
Color.echo("Swarm: #{self.detect_orchestrator}", color)
|
94
95
|
Color.echo(self.detect_services.to_yaml, color)
|
95
96
|
end
|
96
97
|
|
@@ -100,14 +101,14 @@ module DockerCore
|
|
100
101
|
self.write_swarm(swarm)
|
101
102
|
end
|
102
103
|
|
103
|
-
|
104
|
-
self.write_swarm(
|
104
|
+
orchestrator = self.detect_orchestrator
|
105
|
+
self.write_swarm(orchestrator)
|
105
106
|
|
106
|
-
if
|
107
|
-
|
107
|
+
if orchestrator.empty?
|
108
|
+
orchestrator = '<none>'
|
108
109
|
end
|
109
110
|
|
110
|
-
Color.echo("Swarm: #{
|
111
|
+
Color.echo("Swarm: #{orchestrator}", Color::GREEN)
|
111
112
|
end
|
112
113
|
|
113
114
|
# @param [String] base
|
@@ -123,28 +124,32 @@ module DockerCore
|
|
123
124
|
end
|
124
125
|
|
125
126
|
# @param [Array] arguments
|
127
|
+
# @param [Hash] environment
|
128
|
+
# @param [Hash] bind
|
126
129
|
# @param [Boolean] throw
|
127
130
|
# @param [Numeric] wait
|
128
131
|
# @param [Boolean] strip
|
129
132
|
# @param [Boolean] echo
|
130
133
|
# @return [String]
|
131
|
-
def self.capture_command(*arguments, environment: {}, throw: false, wait: 0, strip: true, echo: false)
|
134
|
+
def self.capture_command(*arguments, environment: {}, bind: {}, throw: false, wait: 0, strip: true, echo: false)
|
132
135
|
raise "No implement #{__method__} method"
|
133
136
|
end
|
134
137
|
|
135
138
|
# @param [Array] arguments
|
139
|
+
# @param [Hash] environment
|
140
|
+
# @param [Hash] bind
|
136
141
|
# @param [Boolean] throw
|
137
142
|
# @param [Numeric] wait
|
138
143
|
# @param [Boolean] echo
|
139
144
|
# @return [Boolean]
|
140
|
-
def self.run_command(*arguments, environment: {}, throw: true, wait: 0, echo: true)
|
145
|
+
def self.run_command(*arguments, environment: {}, bind: {}, throw: true, wait: 0, echo: true)
|
141
146
|
raise "No implement #{__method__} method"
|
142
147
|
end
|
143
148
|
|
144
149
|
#noinspection RubyClassVariableUsageInspection
|
145
|
-
def self.
|
146
|
-
@@
|
147
|
-
return "#{@@
|
150
|
+
def self.orchestrator
|
151
|
+
@@orchestrator ||= self.detect_orchestrator
|
152
|
+
return "#{@@orchestrator}"
|
148
153
|
end
|
149
154
|
|
150
155
|
end
|
@@ -538,8 +543,6 @@ module DockerCore
|
|
538
543
|
data = JSON.parse(Net::HTTP.get(uri))['tag_name']
|
539
544
|
return "#{data}"
|
540
545
|
|
541
|
-
|
542
|
-
|
543
546
|
end
|
544
547
|
end
|
545
548
|
|