From 74e3202a2666585a1414d9cd2176ca0a7ec674dc Mon Sep 17 00:00:00 2001 From: Rien Maertens Date: Wed, 13 Feb 2019 20:54:18 +0100 Subject: [PATCH] Add deploy script --- deploy.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..bcb9630 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -eo pipefail + +if [ git status --porcelain=2 -uno | grep '' ]; then + echo "You have unstaged changes." + echo "This shouldn't happen in production." + echo "Plsfix. Dank." + exit 1 +fi + +echo "Pulling from remote." +git pull + +echo "Updating dependencies." +~/env/bin/pip install requirements.txt + +echo "Migrating database." +~/env/bin/flask db upgrade + +echo "Restarting server using passenger." +passenger-config restart-app .