2020-11-09 13:47:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-09 14:52:02 +00:00
|
|
|
export DIR=$(dirname $0)
|
2020-11-09 13:47:30 +00:00
|
|
|
|
|
|
|
function prefix_date(){
|
|
|
|
while read line
|
|
|
|
do
|
|
|
|
echo [$(date)] $line
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_update(){
|
2020-11-09 14:52:02 +00:00
|
|
|
cd $DIR
|
|
|
|
echo run autoupdate in $(pwd)
|
2020-11-09 13:47:30 +00:00
|
|
|
git pull
|
|
|
|
cd backend
|
2021-03-28 21:31:39 +00:00
|
|
|
source venv/bin/activate
|
|
|
|
pip3 install -r requirements.txt
|
2020-11-09 15:06:26 +00:00
|
|
|
python3 manage.py migrate
|
|
|
|
python3 manage.py collectstatic --noinput
|
2021-03-28 21:31:39 +00:00
|
|
|
echo done
|
2020-11-09 13:47:30 +00:00
|
|
|
}
|
|
|
|
|
2020-11-09 14:52:02 +00:00
|
|
|
run_update | prefix_date >> $DIR/update.log
|