summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CLAUDE.md2
-rwxr-xr-xgit/hooks/studio-slots/post-receive12
-rw-r--r--git/repos.txt2
-rw-r--r--hetzner-admin/app.py2
-rwxr-xr-xhetzner-admin/run-command.sh3
5 files changed, 13 insertions, 8 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 0c47b6b..b595740 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -41,7 +41,7 @@ server/ サーバー共通設定(authorized_keys, requirements.md)
| microblog | /app/microblog |
| todo | /app/todo |
| license-slot-checker | /home/yyamashita/workspaces/repos/license-slot-checker |
-| studio-slots | /home/yyamashita/workspaces/repos/studio-slots |
+| studio-slots | /app/studio-slots |
## よく使うコマンド
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"
diff --git a/git/repos.txt b/git/repos.txt
index df165ba..39757fe 100644
--- a/git/repos.txt
+++ b/git/repos.txt
@@ -7,4 +7,4 @@ mosquitone-admin:/home/yyamashita/workspaces/repos/mosquitone-admin
microblog:/app/microblog
todo:/app/todo
license-slot-checker:/home/yyamashita/workspaces/repos/license-slot-checker
-studio-slots:/home/yyamashita/workspaces/repos/studio-slots
+studio-slots:/app/studio-slots
diff --git a/hetzner-admin/app.py b/hetzner-admin/app.py
index 17895d9..07fa550 100644
--- a/hetzner-admin/app.py
+++ b/hetzner-admin/app.py
@@ -67,7 +67,7 @@ COMMANDS = [
COMMAND_MAP = {label: cmd for label, cmd in COMMANDS}
# 個別に停止・起動できるサービス(run-command.sh の SERVICES と status/targets.txt の名前に合わせる)
-SERVICES = ["golive", "whoisband", "blog", "todo", "git", "vpn", "ntfy", "mail", "code"]
+SERVICES = ["golive", "whoisband", "blog", "todo", "studio", "git", "vpn", "ntfy", "mail", "code"]
# ブラウザ側: JSON ⇔ WebAuthn の変換はブラウザ組み込みの
# parseCreationOptionsFromJSON / parseRequestOptionsFromJSON / toJSON に任せる
diff --git a/hetzner-admin/run-command.sh b/hetzner-admin/run-command.sh
index b473ce4..dab4f4d 100755
--- a/hetzner-admin/run-command.sh
+++ b/hetzner-admin/run-command.sh
@@ -4,7 +4,7 @@ set -e
# 管理画面から停止・起動できるサービス(名前は status/targets.txt の名前に合わせる)
# Caddy / hetzner-admin / status は止めると管理画面に戻れなくなるので対象外
-SERVICES="golive whoisband blog todo git vpn ntfy mail code"
+SERVICES="golive whoisband blog todo studio git vpn ntfy mail code"
# docker compose ではなく systemd で動くサービス
service_unit() {
case "$1" in
@@ -18,6 +18,7 @@ service_compose() {
whoisband) echo /app/whois-band/docker-compose.yml ;;
blog) echo /app/microblog/docker-compose.yml ;;
todo) echo /app/todo/docker-compose.yml ;;
+ studio) echo /app/studio-slots/docker-compose.yml ;;
git) echo /app/infra/cgit/docker-compose.yml ;;
vpn) echo /app/infra/vpn/docker-compose.yml ;;
ntfy) echo /app/infra/ntfy/docker-compose.yml ;;