forget-cancellare-vecchi-toot/tools/post-receive.example

23 lines
567 B
Plaintext
Raw Normal View History

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
pip install -r requirements.txt
tools/write-version.sh
FLASK_APP='forget.py' flask db upgrade
)
systemctl --user start forget
fi
done