Prune old images on deploy host after deployment

This commit is contained in:
Jan Tuomi
2017-09-15 20:36:24 +03:00
parent 7e36fd5768
commit 040c9641ea
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -73,4 +73,4 @@ deploy:
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- scp docker-compose.yml $SSH_USER@$SSH_HOST:~/deployment/docker-compose.yml
- ssh $SSH_USER@$SSH_HOST "cd deployment && docker-compose down && docker pull \"$IMAGE_NAME\" && docker-compose up -d"
- ssh $SSH_USER@$SSH_HOST "cd deployment && docker-compose down && docker pull \"$IMAGE_NAME\" && docker-compose up -d && docker image prune -f"