mirror of
https://github.com/codl/forget
synced 2024-12-13 17:08:12 +01:00
35 lines
774 B
Bash
Executable File
35 lines
774 B
Bash
Executable File
#!/bin/sh
|
|
|
|
|
|
while read old new refname; do
|
|
|
|
export GIT_DIR=$(git rev-parse --absolute-git-dir)
|
|
branch=$(git rev-parse --abbrev-ref=strict ${refname})
|
|
|
|
if [[ $branch == "deploy" ]]; then
|
|
|
|
cd "$HOME/forget"
|
|
|
|
export GIT_DIR="$PWD/.git"
|
|
|
|
git checkout deploy
|
|
git fetch --prune origin
|
|
git reset --hard origin/deploy
|
|
|
|
(
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
yarn
|
|
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 restart forget
|
|
fi
|
|
done
|
|
|