summaryrefslogtreecommitdiff
path: root/Deploy.md
diff options
context:
space:
mode:
Diffstat (limited to 'Deploy.md')
-rw-r--r--Deploy.md40
1 files changed, 24 insertions, 16 deletions
diff --git a/Deploy.md b/Deploy.md
index 2a50159..3c6e89b 100644
--- a/Deploy.md
+++ b/Deploy.md
@@ -60,29 +60,37 @@ ssh golive 'docker logs whois-app -f'
4. `git remote add hetzner golive:/var/git/<name>.git`
5. `git push hetzner master`
-## Claude Code リモートセッション(デーモン)
+## Claude Code セッション管理
-各リポジトリに対して Claude Code を常駐プロセスとして起動する。
+`git push` 時に post-receive フック(root)が `yyamashita` ユーザーの systemd user service を自動同期する。
-```bash
-scp scripts/claude-daemon-setup.sh golive:~/
-ssh golive 'bash claude-daemon-setup.sh'
-```
+| ファイル | 役割 |
+|---|---|
+| `systemd/user/claude-code@.service` | サービステンプレート |
+| `claude-code-sessions.txt` | 有効にするセッション一覧(`user:repo` 形式) |
+| `scripts/sync-claude-services.sh` | root が user service を同期するスクリプト |
-起動後は [https://claude.ai/code](https://claude.ai/code) から各リポジトリのセッションに接続できる。
+### セッション追加・削除
-| サービス名 | 対象ディレクトリ |
-|---|---|
-| `claude-infra` | `/app/infra` |
-| `claude-tokyo` | `/app` |
-| `claude-whoisband` | `/app/whois-band` |
+`claude-code-sessions.txt` を編集して `git push hetzner master`:
+
+```
+# 形式: user:repo
+yyamashita:hetzner-infra
+yyamashita:new-repo
+```
+
+### 手動同期(サーバー上で)
```bash
-# 状態確認
-ssh golive 'systemctl status claude-tokyo'
+ssh root@localhost 'bash /app/infra/scripts/sync-claude-services.sh'
+```
-# ログ確認
-ssh golive 'journalctl -u claude-tokyo -f'
+### サービス確認
+
+```bash
+systemctl --user status 'claude-code@*.service'
+tmux ls
```
## 初回サーバーセットアップ(再構築時)