#!/bin/sh

set -e

git pull
docker build --tag=letsmeet-prod .
docker rm -f letsmeet letsmeet-nginx
docker run -d --volumes-from letsmeet-data --link letsmeet-db:db -v `pwd`/letsmeet/letsmeet/settings/production.py:/opt/code/letsmeet/letsmeet/settings/production.py --restart=always --name letsmeet letsmeet-prod
docker run --name letsmeet-nginx --net="host" -v `pwd`/../data:/home/uid1000/letsmeet -v `pwd`/nginx.conf:/etc/nginx/nginx.conf -v /etc/letsencrypt/live/www.letsmeet.click/:/home/uid1000/letsmeet/nginx/ --restart=always -d nginx

echo "Cleaning up old docker images..."
docker rmi $(docker images | grep "<none>" | awk '{print($3)}')

sh notify.sh

#!/bin/sh

set -e

git pull
docker build --tag=letsmeet-prod .
docker rm -f letsmeet letsmeet-nginx
docker run -d --volumes-from letsmeet-data --link letsmeet-db:db -v `pwd`/letsmeet/letsmeet/settings/production.py:/opt/code/letsmeet/letsmeet/settings/production.py --restart=always --name letsmeet letsmeet-prod
docker run --name letsmeet-nginx --net="host" -v `pwd`/../data:/home/uid1000/letsmeet -v `pwd`/nginx.conf:/etc/nginx/nginx.conf --restart=always -d nginx

echo "Cleaning up old docker images..."
docker rmi $(docker images | grep "<none>" | awk '{print($3)}')

sh notify.sh

Revert "mount ssl certificates into container"
Revert "mount ssl certificates into container"

This reverts commit 28d669569d308d28ee4f478e91e4366f13a7a495.
