docker_core 0.0.36 → 0.0.37
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 +42 -9
- 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: e0375cb2f88d368c24f8b45c30ef14a8be4bf0f599b1bbf09aa889ffb4e7ff37
|
4
|
+
data.tar.gz: eb33596964712179047258e7ae4736d7d342fabb8fb0af55f7ee732d52a71e39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 977cc7b87c3e7385cde5f924445c505f4d7c5ca9067ab7e1d35ab4e0cb8d04df470bb95ffb13bc26fbc661636f52565c18666b7d090d2a5bab2666745e389cec
|
7
|
+
data.tar.gz: a800981a96c1978b33236991d25c04dae4f452f952ba55a7a46f5125ed93c01a4e4e5d0b50a0ec283f85f9695dd996f9f5234e193d67d3a1c4b0ec013e482c72
|
data/lib/docker_core.rb
CHANGED
@@ -113,13 +113,46 @@ module DockerCore
|
|
113
113
|
return File.expand_path('~/.swarm')
|
114
114
|
end
|
115
115
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
116
|
+
def self.profile_path
|
117
|
+
return File.realpath('profile.sh', self.deploy_path)
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.runner_path
|
121
|
+
return File.realpath('runner.rb', self.deploy_path)
|
122
|
+
end
|
123
|
+
|
124
|
+
# @see https://github.com/moby/moby/issues/31564
|
125
|
+
# @param [String] name
|
126
|
+
# @param [Boolean] echo
|
127
|
+
def self.check_name(name, echo: false)
|
128
|
+
color = Color::YELLOW
|
129
|
+
name = "#{name}"
|
130
|
+
items = name.chars
|
131
|
+
|
132
|
+
if items.empty? || 63 < items.length
|
133
|
+
if echo
|
134
|
+
Color.echo("'#{name}' should be between 1 and 63 characters long", color)
|
135
|
+
end
|
136
|
+
|
137
|
+
return false
|
138
|
+
end
|
139
|
+
|
140
|
+
if [items.first, items.last].include?('-')
|
141
|
+
if echo
|
142
|
+
Color.echo("'#{name}' should not start or end with a hyphen(-)", color)
|
143
|
+
end
|
144
|
+
|
145
|
+
return false
|
146
|
+
end
|
147
|
+
|
148
|
+
test = name.match?(/^[a-zA-Z0-9-]+$/)
|
149
|
+
|
150
|
+
if false == test && echo
|
151
|
+
Color.echo("'#{name}' should be a-z or A-Z or 0-9 and hyphen (-)", color)
|
152
|
+
end
|
153
|
+
|
154
|
+
return test
|
155
|
+
end
|
123
156
|
|
124
157
|
# @param [String] swarm
|
125
158
|
def self.write_swarm(swarm = '')
|
@@ -583,8 +616,8 @@ module DockerCore
|
|
583
616
|
|
584
617
|
Process.run('deluser', USER, throw: false)
|
585
618
|
Process.run('delgroup', GROUP, throw: false)
|
586
|
-
Process.run('addgroup', { system: true, gid: gid }, GROUP
|
587
|
-
Process.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER
|
619
|
+
Process.run('addgroup', { system: true, gid: gid }, GROUP)
|
620
|
+
Process.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER)
|
588
621
|
end
|
589
622
|
|
590
623
|
# @param [String] stdout
|