Update deploy.sh

This commit is contained in:
AnJia 2018-10-09 13:51:59 +08:00 committed by GitHub
parent c5e2af2029
commit 2416347172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
SECONDS=0
docker_dir=$(docker info | grep "Docker Root Dir" | cut -d':' -f2)
source ./process-utils.sh
process_init 5
process_init 6
red='\033[0;31m'
green='\033[0;32m'
@ -103,7 +103,7 @@ function pull_push_diff()
for tag in ${tmps[@]} ; do
# disk available space (unit:kb)
avail=$(df ${docker_dir}|awk '{if(NR>1)print $4}')
avail=$(df ${docker_dir}|awk '{if(NR>1)print $4/2}')
# all of size about this mirror
space=$(awk '{sum += $1};END {print sum}' /tmp/sum)
@ -113,7 +113,7 @@ function pull_push_diff()
echo -e "${yellow}mirror ${n}/${img}/${tag}(${red}avail:${avail} ${yellow}space:${space} ${plain} my_space:${my_space})..."
# sleep 1 min when insufficient disk
[[ 'space + 1048576 + my_space' -gt avail ]] && sleep 120 && continue;
[[ 'space + my_space' -gt avail ]] && sleep 120 && continue;
# append this image bytes
echo $my_space >> /tmp/sum