From b8073cc539e768ad004b92e682a3f4bd20b68335 Mon Sep 17 00:00:00 2001 From: jedi Date: Mon, 9 Nov 2020 14:47:30 +0100 Subject: [PATCH] autodeploy --- .gitignore | 1 + update.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 update.sh diff --git a/.gitignore b/.gitignore index 097ef35..afadc1d 100644 --- a/.gitignore +++ b/.gitignore @@ -203,3 +203,4 @@ dmypy.json .pyre/ backend/config/ +update.log diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..cc04f4b --- /dev/null +++ b/update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +DIR=$(dirname $0) + +function prefix_date(){ + while read line + do + echo [$(date)] $line + done +} + +function run_update(){ + git pull + cd backend + python manage.py migrate +} + +run_update | prefix_date > $DIR/update.log