Update deploy.sh

This commit is contained in:
AnJia 2018-10-10 13:57:15 +08:00 committed by GitHub
parent 2c2a00af80
commit 438350a2f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -102,6 +102,11 @@ function pull_push_diff()
done
for tag in ${tmps[@]} ; do
used=$(df -h ${docker_dir}|awk '{if(NR>1)print $5}')
echo -e "${red} duration:${duration}s, docker root dir :${docker_dir}:used:${used}"
[[ ${used} > '60%' ]] && docker system prune -f -a && sleep 120
# disk available space (unit:kb)
avail=$(df ${docker_dir}|awk '{if(NR>1)print $4/2}')
@ -233,6 +238,8 @@ do
break
else
docker images
df -h ${docker_dir}
used=$(df -h ${docker_dir}|awk '{if(NR>1)print $5}')
echo -e "${red} duration:${duration}s, docker root dir :${docker_dir}:used:${used}"
[[ ${used} > '60%' ]] && docker system prune -f -a