diff options
| author | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-05-17 11:29:27 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@hetzner.yyamashita.com> | 2026-05-17 11:29:27 +0900 |
| commit | ef6dbdd2ac273dc4a01c70437ee7984cea9f2a3c (patch) | |
| tree | 4db9e4917a3a2ffb4d96d02fd7927dd7dcaabf39 /scripts/server-setup.sh | |
| parent | fa8880f38783bebbce805f8595c949b9c7f326a0 (diff) | |
Reorganize repo into caddy/, git/, claude/ directories
- caddy/: Caddyfile, docker-compose.yml, deploy.sh (hook runs this only)
- git/: repos.txt, hooks/*/post-receive, install.sh, server-setup.sh
- claude/: sessions.txt, systemd/claude-code@.service, sync.sh
Post-receive hook is now: checkout + bash caddy/deploy.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'scripts/server-setup.sh')
| -rw-r--r-- | scripts/server-setup.sh | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/scripts/server-setup.sh b/scripts/server-setup.sh deleted file mode 100644 index ca9a3f9..0000000 --- a/scripts/server-setup.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Run once on a fresh Hetzner VPS (as root). -# hetzner-infra のみブートストラップとして作成する。 -# 他のリポジトリは最初の push 後に install.sh が作成する。 -set -e - -REPO_DIR=/var/git/hetzner-infra.git -APP_DIR=/app/infra - -# Install Docker -curl -fsSL https://get.docker.com | sh - -# Create shared Docker network -docker network create web || true - -# hetzner-infra bare repo をブートストラップ -mkdir -p "$REPO_DIR" "$APP_DIR" -git init --bare "$REPO_DIR" - -# 最初の push を受け取るための最小限のフック(install.sh 実行後に上書きされる) -cat > "$REPO_DIR/hooks/post-receive" << 'HOOK' -#!/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" -if [ -f "$APP_DIR/scripts/sync-claude-services.sh" ]; then - bash "$APP_DIR/scripts/sync-claude-services.sh" -fi -HOOK -chmod +x "$REPO_DIR/hooks/post-receive" - -echo "" -echo "Next steps:" -echo " 1. git remote add origin root@<server-ip>:$REPO_DIR" -echo " 2. git push origin master" -echo " 3. ssh root@<server-ip> 'bash $APP_DIR/scripts/install.sh'" -echo " (他のリポジトリ作成 + 全フックの正式インストール)" |
