diff --git a/registry-cleaner.sh b/registry-cleaner.sh index 210f8ed..5d533c9 100755 --- a/registry-cleaner.sh +++ b/registry-cleaner.sh @@ -12,14 +12,12 @@ DIRNAME=$(dirname $SCRIPT) # Soft delete untagged images. # ----------------------------------------------------------------------------- -if [ -t 1 ]; then - echo -e "${CYAN}[${SCRIPT}] Soft delete untagged images ${NC}" -fi +echo -e "${CYAN}[${SCRIPT}] Soft delete untagged images ${NC}" install="pip3 install gitlab-registry-cleanup" cleanup="gitlab-registry-cleanup -g https://gitlab.wojciechkozlowski.eu -r https://registry.wojciechkozlowski.eu -c /gitlab.cred" -docker run -it --rm --volumes-from gitlab \ +docker run --rm --volumes-from gitlab \ -v ${DIRNAME}/gitlab.cred:/gitlab.cred \ python bash -c "${install} && ${cleanup}" @@ -27,8 +25,6 @@ docker run -it --rm --volumes-from gitlab \ # Garbage collect and hard delete untagged images. # ----------------------------------------------------------------------------- -if [ -t 1 ]; then - echo -e "${CYAN}[${SCRIPT}] Garbage collect untagged images ${NC}" -fi +echo -e "${CYAN}[${SCRIPT}] Garbage collect untagged images ${NC}" docker exec gitlab bash -c "gitlab-ctl registry-garbage-collect"