Add .deploy-token and .envrc to gitignore, add utility scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-02-12 09:33:18 +09:00
parent 3d97190186
commit cde2ddc713
2 changed files with 20 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
node_modules/
.wrangler/
.dev.vars
.deploy-token
.envrc

18
scripts/deploy.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
# .deploy-token 파일에서 토큰을 읽거나, 환경변수에서 가져옴
TOKEN_FILE="$(dirname "$0")/../.deploy-token"
if [[ -f "$TOKEN_FILE" ]]; then
CLOUDFLARE_API_TOKEN="$(cat "$TOKEN_FILE" | tr -d '[:space:]')"
elif [[ -n "${CLOUDFLARE_API_TOKEN:-}" ]]; then
: # already set
else
echo "Error: .deploy-token 파일이 없고 CLOUDFLARE_API_TOKEN 환경변수도 없습니다."
echo " vault에서 토큰을 가져와 .deploy-token 에 저장하세요."
exit 1
fi
export CLOUDFLARE_API_TOKEN
exec npx wrangler deploy "$@"