docker-runner 1.0.0 → 1.0.1
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/README.md +2 -1
- data/bin/include/functions.sh +24 -12
- data/lib/docker/runner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c7ab3124e1537797438f905e51456f760704041
|
4
|
+
data.tar.gz: 40b1d47cb3cd6679f1620a559bb4c0ff2a9c70c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aa9cfc86ba310e82c0b31bc4e2e67b52b57c5ff6e3a550e22f4d076ebeb6f2513c73fc22068d76dbf039bb44fc5c9d7c29b7701c5def473fe95370aa21af52d
|
7
|
+
data.tar.gz: d38970934855f43dcbdc5378e1b7d3b8713953709a85a2bfcb89b8fc92970a43c4bed6e694761d7cc2beb150c222e92cea93db254049d73dc224836976bfef2b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Docker::Runner
|
2
2
|
|
3
|
-
A
|
3
|
+
A Docker Runner Cli
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -21,6 +21,7 @@ A Rails Like Docker Runner Cli
|
|
21
21
|
- docker-runner login 登录镜像远程仓库
|
22
22
|
- docker-runner logout 退出镜像远程仓库
|
23
23
|
- docker-runner console 开启镜像控制台
|
24
|
+
- docker-runner clean Docker环境清理
|
24
25
|
- docker-runner update 更新镜像模板
|
25
26
|
- docker-runner version 查看当前版本
|
26
27
|
|
data/bin/include/functions.sh
CHANGED
@@ -93,7 +93,7 @@ reset_global_env() {
|
|
93
93
|
|
94
94
|
require_global_env() {
|
95
95
|
if [ -r "$HOME/.docker-runner" ]; then
|
96
|
-
return
|
96
|
+
return 0
|
97
97
|
else
|
98
98
|
echo "**请先执行docker-runner setup, 进行环境初始化"
|
99
99
|
exit 11
|
@@ -101,8 +101,8 @@ require_global_env() {
|
|
101
101
|
}
|
102
102
|
|
103
103
|
require_project_env() {
|
104
|
-
if require_global_env && [ -r "
|
105
|
-
return
|
104
|
+
if require_global_env && [ -r "$PWD/.docker-runner" ]; then
|
105
|
+
return 0
|
106
106
|
else
|
107
107
|
echo "**当前目录不是镜像项目, 请切换至镜像项目"
|
108
108
|
exit 12
|
@@ -267,22 +267,34 @@ error(){
|
|
267
267
|
}
|
268
268
|
|
269
269
|
valid_readme() {
|
270
|
-
if [
|
270
|
+
if [ ! -r $README_PATH ]; then
|
271
|
+
read -p "README.md不存在, 是否生成? (Y/n)" is_reset_readme
|
272
|
+
|
273
|
+
if [ "$is_reset_readme" = 'n' ]; then
|
274
|
+
error "README.md不存在, 停止构建镜像"
|
275
|
+
return 1
|
276
|
+
else
|
277
|
+
reset_readme
|
278
|
+
return 0
|
279
|
+
fi
|
280
|
+
|
281
|
+
elif [ `grep -c "$VALID_STR" $README_PATH` -gt 0 ]; then
|
271
282
|
error $BUILD_ERR && \
|
272
283
|
open $README_PATH &&
|
284
|
+
return 1
|
285
|
+
else
|
273
286
|
return 0
|
274
287
|
fi
|
275
|
-
return 1
|
276
288
|
}
|
277
289
|
|
278
290
|
valid_variables() {
|
279
|
-
local result=
|
291
|
+
local result=0
|
280
292
|
if [ ! -n "$username" ] ;then
|
281
|
-
error '请在.docker-runner文件中配置username' && result=
|
293
|
+
error '请在.docker-runner文件中配置username' && result=1
|
282
294
|
fi
|
283
295
|
|
284
296
|
if [ ! -n "$image" ];then
|
285
|
-
error '请在.docker-runner文件中配置image' && result=
|
297
|
+
error '请在.docker-runner文件中配置image' && result=1
|
286
298
|
fi
|
287
299
|
|
288
300
|
return $result
|
@@ -378,13 +390,13 @@ do_config() {
|
|
378
390
|
}
|
379
391
|
|
380
392
|
do_build() {
|
381
|
-
valid_readme
|
382
|
-
valid_variables
|
393
|
+
valid_readme &&\
|
394
|
+
valid_variables && build_image
|
383
395
|
}
|
384
396
|
|
385
397
|
do_push() {
|
386
|
-
valid_readme
|
387
|
-
valid_variables
|
398
|
+
valid_readme &&\
|
399
|
+
valid_variables && push_image
|
388
400
|
}
|
389
401
|
|
390
402
|
do_login() {
|