multimail/update.sh
2021-03-28 23:43:56 +02:00

24 lines
389 B
Bash
Executable file

#!/bin/bash
export DIR=$(dirname $0)
function prefix_date(){
while read line
do
echo [$(date)] $line
done
}
function run_update(){
cd $DIR
echo run autoupdate in $(pwd)
git pull
cd backend
source venv/bin/activate
pip3 install -r requirements.txt
python3 manage.py migrate
python3 manage.py collectstatic --noinput
echo done
}
run_update | prefix_date >> $DIR/update.log