Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker prune is in deploy script, cron schedule is off #1153

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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