diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0cd18ca..6962fee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,6 @@ build: before_script: - docker login -u mathwave -p $DOCKERHUB_PASSWORD script: - - docker 2>/dev/null rmi docker images -q mathwave/sprint-repo || true - docker stack deploy -c ./docker-compose-deploy.yaml sprint deploy-dev: diff --git a/daemons/management/commands/docker_cleaner.py b/daemons/management/commands/docker_cleaner.py index 77529ec..80bd4a2 100644 --- a/daemons/management/commands/docker_cleaner.py +++ b/daemons/management/commands/docker_cleaner.py @@ -7,6 +7,11 @@ class Command(MessagingSupport): help = "starts docker cleaner" queue_name = "cleaner" + def handle(self, *args, **options): + call('docker image rm $(docker images -q mathwave/sprint-repo)', shell=True) + print("Old images removed") + super().handle(*args, **options) + def process(self, payload: dict): name = payload['name'] type = payload['type']