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 1 commit
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
6 changes: 6 additions & 0 deletions infrastructure/deployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ split_and_join() {
SPLIT=$(echo $text | sed -e "s/$separator_for_splitting/$separator_for_joining/g")
echo $SPLIT
}
cleanup_docker_images()
{
/usr/bin/docker system prune -af >> /var/log/docker-prune.log
}

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

rotate_secrets

cleanup_docker_images

docker_stack_deploy

echo
Expand Down
8 changes: 0 additions & 8 deletions infrastructure/server-setup/tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@
username: '{{dockerhub_username}}'
password: '{{dockerhub_password}}'

- name: 'Setup crontab to clean up docker images'
cron:
user: '{{ crontab_user }}'
name: 'cleanup docker images'
minute: '0'
hour: '0'
job: '/usr/bin/docker system prune -af >> /var/log/docker-prune.log'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we need to keep this for a while and set it to state: absent instead - otherwise it only doesn't get installed to new environments but never gets removed from the existing environments

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i am changing it right now

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