From cde2ddc713504aab0b8f138782caf611180cb884 Mon Sep 17 00:00:00 2001 From: kappa Date: Thu, 12 Feb 2026 09:33:18 +0900 Subject: [PATCH] Add .deploy-token and .envrc to gitignore, add utility scripts Co-Authored-By: Claude Opus 4.6 --- .gitignore | 2 ++ scripts/deploy.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 scripts/deploy.sh diff --git a/.gitignore b/.gitignore index a933f10..d963ba5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules/ .wrangler/ .dev.vars +.deploy-token +.envrc diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100755 index 0000000..760fb5b --- /dev/null +++ b/scripts/deploy.sh @@ -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 "$@"