fix(deploy): .env 에 .env.example 신규 키 자동 sync — backend 부팅 실패 방지#29
Merged
Conversation
배경: PR #27 머지 후 self-hosted runner 가 자동 발화해 backend 컨테이너를 빌드/실행 했으나 Exit (1) 로 31시간 방치됨. 원인: - PR #27 이 .env.example 에 backend 비밀값 16개 (JWT_SECRET, ENCRYPTION_KEY, ...) 를 추가 - 원격 서버 .env 는 이미 존재 → 기존 워크플로우 'Ensure .env exists' 단계가 cp .env.example .env 를 skip → .env 에 새 키들 부재 - docker-compose 의 \${JWT_SECRET:-} 가 빈 문자열을 Spring 에 주입 (env 가 unset 이 아니라 set-but-empty 상태로 전달됨) - Spring SecurityProperties / GithubOAuthProperties 의 @notblank 검증 실패 수정: - Secret 주입 단계 직후, .env.example 에 있지만 .env 에 없는 키 목록을 추출해 default 값과 함께 .env 끝에 append (기존 값은 절대 덮어쓰지 않음) - "# ---- synced from .env.example by deploy-app.yml ----" 주석으로 구분 - awk 한 블럭 — 외부 의존성 없음 검증 (로컬 dry run): - 기존 .env (POSTGRES_PASSWORD=mysecret123, LLM_API_KEY=abc) 보존 - .env.example 에만 있던 JWT_SECRET, ENCRYPTION_KEY, NEW_KEY append 확인 오늘 원격 .env 는 이미 수동 복구되어 backend healthy. 본 PR 머지 이후로는 .env.example 신규 키 추가 시 자동 sync 되어 같은 사고 반복 없음.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #27 머지 후 self-hosted runner 가 자동 발화해 backend 컨테이너를 빌드 했으나 Exit (1) 실패
원인:
수정:
검증 (로컬 dry run):
오늘 원격 .env 는 이미 수동 복구되어 backend healthy. 본 PR 머지 이후로는 .env.example 신규 키 추가 시 자동 sync 되어 같은 사고 반복 없음.