diff options
Diffstat (limited to 'git/hooks/studio-slots')
| -rwxr-xr-x | git/hooks/studio-slots/post-receive | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git/hooks/studio-slots/post-receive b/git/hooks/studio-slots/post-receive index 15bcf9b..4036417 100755 --- a/git/hooks/studio-slots/post-receive +++ b/git/hooks/studio-slots/post-receive @@ -1,7 +1,11 @@ #!/bin/bash set -e -WORK_TREE=/home/yyamashita/workspaces/repos/studio-slots -GIT_WORK_TREE=$WORK_TREE git checkout -f -# フックは root で動くので、作業ディレクトリの所有者を戻す -chown -R yyamashita:yyamashita "$WORK_TREE" +APP_DIR=/app/studio-slots +GIT_WORK_TREE=$APP_DIR git checkout -f +cd $APP_DIR +# ファイルが無いままマウントするとディレクトリが作られてしまうので先に作る +[ -f manual_slots.json ] || echo '{}' > manual_slots.json +# push でデプロイしたら管理画面の停止状態を解除する +sed -i '/^studio$/d' /app/infra/status/stopped.txt 2>/dev/null || true +docker compose up -d --build echo "Deploy complete: studio-slots" |
