2017-08-07 14:51:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-08-07 14:56:18 +02:00
|
|
|
export GIT_DIR=$(git rev-parse --absolute-git-dir)
|
|
|
|
|
2017-08-07 14:51:33 +02:00
|
|
|
while read old new refname; do
|
|
|
|
branch=$(git rev-parse --abbrev-ref=strict ${refname})
|
|
|
|
if [[ $branch == "deploy" ]]; then
|
2017-08-07 14:56:18 +02:00
|
|
|
|
2017-08-07 14:51:33 +02:00
|
|
|
systemctl --user stop forget
|
|
|
|
GIT_WORK_TREE='/home/codl/forget' git checkout -f deploy
|
|
|
|
|
|
|
|
(
|
|
|
|
cd /home/codl/forget
|
|
|
|
source venv/bin/activate
|
2017-08-19 13:21:00 +02:00
|
|
|
env -u GIT_DIR -u GIT_WORK_TREE pip install -r requirements.txt
|
2017-08-31 22:42:59 +02:00
|
|
|
yarn
|
2017-08-07 14:51:33 +02:00
|
|
|
tools/write-version.sh
|
|
|
|
FLASK_APP='forget.py' flask db upgrade
|
2017-08-11 14:57:32 +02:00
|
|
|
if [[ $(git diff --name-only ${old}..${new} dodo.py) == 'dodo.py' ]]
|
|
|
|
then
|
2017-08-20 20:22:53 +02:00
|
|
|
rm -rf static
|
|
|
|
mkdir static
|
2017-08-11 14:57:32 +02:00
|
|
|
fi
|
|
|
|
doit
|
2017-08-07 14:51:33 +02:00
|
|
|
)
|
|
|
|
systemctl --user start forget
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|