summaryrefslogtreecommitdiff
path: root/server-hooks
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-05-17 11:09:01 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-05-17 11:09:01 +0900
commitcc62d128021ed393f190560297ffaa4a2c259290 (patch)
treebbfc4bab499db0770b0b37fdad39031dcd7ab75c /server-hooks
parentb836174d5ad5e4ea36a5f456061a00862317375f (diff)
Manage all server-side git hooks in this repository
Add server-hooks/<repo>/post-receive for all repos and scripts/install-hooks.sh to deploy them manually on the server. Hooks are not auto-installed on git push for security. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'server-hooks')
-rwxr-xr-xserver-hooks/hetzner-infra/post-receive14
-rwxr-xr-xserver-hooks/tokyo-livehouse-events/post-receive10
-rwxr-xr-xserver-hooks/whois-band/post-receive8
3 files changed, 32 insertions, 0 deletions
diff --git a/server-hooks/hetzner-infra/post-receive b/server-hooks/hetzner-infra/post-receive
new file mode 100755
index 0000000..cc3fa8e
--- /dev/null
+++ b/server-hooks/hetzner-infra/post-receive
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e
+APP_DIR=/app/infra
+GIT_WORK_TREE=$APP_DIR git checkout -f
+cd $APP_DIR
+docker network create web 2>/dev/null || true
+docker compose up -d
+docker compose exec -T caddy caddy reload --config /etc/caddy/Caddyfile 2>/dev/null || true
+echo "Deploy complete: hetzner-infra"
+
+# Claude Code セッション同期
+if [ -f "$APP_DIR/scripts/sync-claude-services.sh" ]; then
+ bash "$APP_DIR/scripts/sync-claude-services.sh"
+fi
diff --git a/server-hooks/tokyo-livehouse-events/post-receive b/server-hooks/tokyo-livehouse-events/post-receive
new file mode 100755
index 0000000..8d5ef84
--- /dev/null
+++ b/server-hooks/tokyo-livehouse-events/post-receive
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+APP_DIR=/app
+GIT_DIR=/var/git/tokyo-livehouse-events.git
+
+git --work-tree=$APP_DIR --git-dir=$GIT_DIR checkout -f
+cd $APP_DIR
+mkdir -p data
+docker compose up -d --build
+echo "Deploy complete: tokyo-livehouse-events"
diff --git a/server-hooks/whois-band/post-receive b/server-hooks/whois-band/post-receive
new file mode 100755
index 0000000..60b368f
--- /dev/null
+++ b/server-hooks/whois-band/post-receive
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e
+APP_DIR=/app/whois-band
+GIT_WORK_TREE=$APP_DIR git checkout -f
+cd $APP_DIR
+mkdir -p data
+docker compose up -d --build
+echo "Deploy complete: whois-band"