Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions infrastructure/deployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ split_and_join() {
SPLIT=$(echo $text | sed -e "s/$separator_for_splitting/$separator_for_joining/g")
echo $SPLIT
}
cleanup_docker_images()
{
echo "Cleaning up the docker images"
/usr/bin/docker system prune -af | sudo tee -a /var/log/docker-prune.log > /dev/null
}

docker_stack_deploy() {
echo "Deploying this environment: $ENVIRONMENT_COMPOSE"
Expand Down Expand Up @@ -379,6 +384,8 @@ configured_ssh "/opt/opencrvs/infrastructure/setup-deploy-config.sh $HOST"

rotate_secrets

cleanup_docker_images

docker_stack_deploy

echo
Expand Down
3 changes: 1 addition & 2 deletions infrastructure/server-setup/tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
cron:
user: '{{ crontab_user }}'
name: 'cleanup docker images'
minute: '0'
hour: '0'
job: '/usr/bin/docker system prune -af >> /var/log/docker-prune.log'
state: absent

- name: Check if Docker group exists
command: getent group docker
Expand Down
Loading