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:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
node_modules/
|
||||
.wrangler/
|
||||
.dev.vars
|
||||
.deploy-token
|
||||
.envrc
|
||||
|
||||
18
scripts/deploy.sh
Executable file
18
scripts/deploy.sh
Executable 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 "$@"
|
||||
Reference in New Issue
Block a user