2
0
mirror of https://github.com/codl/forget synced 2024-12-14 01:14:34 +01:00
forget-cancellare-vecchi-toot/tools/post-receive.example
2017-08-31 22:43:16 +02:00

30 lines
805 B
Bash

#!/bin/sh
export GIT_DIR=$(git rev-parse --absolute-git-dir)
while read old new refname; do
branch=$(git rev-parse --abbrev-ref=strict ${refname})
if [[ $branch == "deploy" ]]; then
systemctl --user stop forget
GIT_WORK_TREE='/home/codl/forget' git checkout -f deploy
(
cd /home/codl/forget
source venv/bin/activate
env -u GIT_DIR -u GIT_WORK_TREE pip install -r requirements.txt
yarn
tools/write-version.sh
FLASK_APP='forget.py' flask db upgrade
if [[ $(git diff --name-only ${old}..${new} dodo.py) == 'dodo.py' ]]
then
rm -rf static
mkdir static
fi
doit
)
systemctl --user start forget
fi
done