File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,13 @@ gh auth login
162
162
./copy.sh nginx:1.14 ikrong/nginx:1.14 --pull
163
163
` ` `
164
164
165
+ 10. 脚本默认会有确认提示,使用参数 -y 可以跳过确认执行
166
+
167
+ ` ` ` shell
168
+ ./copy.sh nginx:1.14 ikrong/nginx:1.14 -y
169
+ ./sync.sh nginx ikrong -y
170
+ ` ` `
171
+
165
172
# # 镜像同步之后如何使用
166
173
167
174
当使用上面办法将镜像同步到阿里云容器镜像仓库后,就可以直接使用阿里云容器镜像仓库的镜像了。
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ WORKFLOW=
9
9
BRANCH=" main"
10
10
INPUTS=
11
11
PULL=
12
+ CONFIRM=
12
13
13
14
# 你可以在这里修改执行的默认值,请保证顺序一致
14
15
INPUT_CONFIGS=(docker.io registry.cn-beijing.aliyuncs.com)
@@ -327,7 +328,12 @@ function trigger() {
327
328
echo " $( g ${inputs[$i]} ) "
328
329
}
329
330
fi
330
- read -p " Confirm? [Y/n] "
331
+ local REPLY
332
+ if [ " $CONFIRM " = " true" ]; then
333
+ REPLY=" y"
334
+ else
335
+ read -p " Confirm? [Y/n] "
336
+ fi
331
337
if [[ $REPLY =~ ^[Yy]$ ]] || [ -z $REPLY ]; then
332
338
echo " gh api \
333
339
--method POST \
@@ -531,6 +537,9 @@ while [ $# -gt 0 ]; do
531
537
--pull)
532
538
PULL=" true"
533
539
;;
540
+ -y | --y | --yes)
541
+ CONFIRM=" true"
542
+ ;;
534
543
trigger)
535
544
CMD=" trigger"
536
545
;;
You can’t perform that action at this time.
0 commit comments