docker_core 0.0.33 → 0.0.34
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/lib/docker_core.rb +8 -67
- 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: 5e196caa3ad51a15efa9e55d0def50e88d1798ae8df091b035b7c8b6cd2b2417
|
|
4
|
+
data.tar.gz: 2f1239749845ee727bdf21102d68fdf68ea686ab10bc1fb24509a3d265be9cfc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ecbab6bd1ff332c4ef71749968f47ca85c483bf79bf0d8ec40046635a269c20366daac6867fe2203c3cac1024f756296c30cbefc53315c41cc6ddd94d0a6131
|
|
7
|
+
data.tar.gz: 292e36438fbaa30436978d94859e895ce06facf013b8d5af26ac8db727ec6df886e65cc3515573fe78c75a5c6138c72bc5965c163009fa80c666e09b155f9a62
|
data/lib/docker_core.rb
CHANGED
|
@@ -81,63 +81,6 @@ module DockerCore
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
class Runner < Thor
|
|
84
|
-
desc('swarm_command', 'show swarm command')
|
|
85
|
-
def swarm_command
|
|
86
|
-
Process.run('ruby', Swarm.runner_path, sudo: false)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
desc('swarm_setup', 'setup swarm')
|
|
90
|
-
def swarm_setup
|
|
91
|
-
Error.no_method(__method__)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
desc('swarm_leave', 'leave swarm')
|
|
95
|
-
def swarm_leave
|
|
96
|
-
Error.no_method(__method__)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
desc('stack_deploy', 'deploy stack')
|
|
100
|
-
def stack_deploy
|
|
101
|
-
Error.no_method(__method__)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
desc('stack_remove', 'remove stack')
|
|
105
|
-
def stack_remove
|
|
106
|
-
Error.no_method(__method__)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
desc('swarm_status', 'show swarm service status')
|
|
110
|
-
def swarm_status
|
|
111
|
-
Swarm.swarm_status
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
desc('update_swarm [orchestrator]', 'update default orchestrator')
|
|
115
|
-
def update_swarm(orchestrator = '')
|
|
116
|
-
Swarm.update_swarm(orchestrator)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
desc('update_core', 'update gem docker_core')
|
|
120
|
-
def update_core
|
|
121
|
-
Process.run('gem update docker_core')
|
|
122
|
-
Process.run('gem clean')
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
desc('update_alias', 'update alias')
|
|
126
|
-
def update_alias
|
|
127
|
-
script = Swarm.script_path
|
|
128
|
-
method = __method__.to_s
|
|
129
|
-
items = ['unalias -a']
|
|
130
|
-
|
|
131
|
-
self.class.all_commands.filter do |key, value|
|
|
132
|
-
next false == ['help', method].include?("#{key}")
|
|
133
|
-
end.each do |key, value|
|
|
134
|
-
items << "alias #{key}='#{__FILE__} #{key}' "
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
items << "alias #{method}='source #{script}' \n"
|
|
138
|
-
File.write(File.expand_path('~/.bash_aliases'), items.join("\n"))
|
|
139
|
-
Color.echo("Update #{items.size} aliases", Color::GREEN)
|
|
140
|
-
end
|
|
141
84
|
end
|
|
142
85
|
|
|
143
86
|
module Image
|
|
@@ -158,16 +101,6 @@ module DockerCore
|
|
|
158
101
|
return "#{registry}/#{namespace}/#{image}:#{tag}"
|
|
159
102
|
end
|
|
160
103
|
|
|
161
|
-
# @return [String]
|
|
162
|
-
def self.script_path
|
|
163
|
-
Error.no_method(__method__)
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
# @return [String]
|
|
167
|
-
def self.runner_path
|
|
168
|
-
Error.no_method(__method__)
|
|
169
|
-
end
|
|
170
|
-
|
|
171
104
|
def self.deploy_path
|
|
172
105
|
return File.expand_path('~/deploy')
|
|
173
106
|
end
|
|
@@ -176,6 +109,14 @@ module DockerCore
|
|
|
176
109
|
return File.expand_path('~/.swarm')
|
|
177
110
|
end
|
|
178
111
|
|
|
112
|
+
def self.profile_path
|
|
113
|
+
return File.realpath('profile.sh', self.deploy_path)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def self.runner_path
|
|
117
|
+
return File.realpath('runner.rb', self.deploy_path)
|
|
118
|
+
end
|
|
119
|
+
|
|
179
120
|
# @param [String] swarm
|
|
180
121
|
def self.write_swarm(swarm = '')
|
|
181
122
|
return File.write(self.swarm_path, "#{swarm}\n")
|