summaryrefslogtreecommitdiff
path: root/git/hooks/studio-slots/post-receive
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-11-01 09:11:31 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-11-01 09:11:31 +0900
commitae0d8e0ea7a35d6df1cada062480d3c43cdb1c78 (patch)
treeaa389169928e3c58d6625a8889525f4cdf5a4e28 /git/hooks/studio-slots/post-receive
parent689b4f4a706746f481555b9a64ff20b33b8e5a75 (diff)
studio-slots を /app/studio-slots にデプロイし管理画面に追加
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'git/hooks/studio-slots/post-receive')
-rwxr-xr-xgit/hooks/studio-slots/post-receive12
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"