Repository navigation
[Fix] 배포 워크플로가 실패를 성공으로 표시하고 동시 배포가 충돌하던 문제 수정 (#48) - #49
Merged
Merged
Conversation
서버에서 docker compose up 이 실패해도 마지막 prune 명령이 성공해 Actions 에는 성공으로 표시되었고, main 에 연달아 머지하면 배포가 동시에 실행되어 컨테이너 이름 충돌이 났다. 이 때문에 #43, #45, #47 이 운영에 반영되지 않았다. - concurrency(group: deploy-prod, cancel-in-progress: false) 추가: 배포는 한 번에 하나만 실행하고, 대기 중이던 이전 실행은 최신 실행으로 대체 - 서버 스크립트에 set -e 추가, docker compose up 의 종료 코드를 저장했다가 마지막에 반환해 실패가 단계 실패로 전달되도록 수정. 실패해도 prune 은 실행해 디스크를 비우고, prune 실패는 배포 결과에 영향을 주지 않음 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
seohyun27
reviewed
Oct 13, 2026
|
|
||
| on: | ||
| push: | ||
| branches: [ "main", "develop" ] # main과 develop 브랜치에 push될 때 작동 |
Contributor
There was a problem hiding this comment.
develop는 사용이 없어서 CICD 범위에서 제외했습니다
Contributor
|
서버 쪽 조치 완료했습니다. 원인
조치
확인 결과
|
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.
개요
배포 워크플로(
CI/CD Pipeline,deploy.yml)가 서버에서docker compose up이 실패해도 Actions에는 성공으로 표시되고, 연달아 머지하면 배포가 동시에 실행되어 충돌하던 문제를 수정합니다. 2026-10-12에 #43, #45, #47을 머지했는데 운영에는 반영되지 않았고 Swagger 배포 일시가 바뀌지 않은 원인입니다.Closes #48
원인
Actions 로그(
7. EC2 접속 후 Docker 실행)에서 확인한 내용입니다.No space left on device(humix-ai-cpu이미지 빌드 중) →failed to solveConflict. The container name "/0f7482c38e11_humix-backend-prod" is already in useprune)이 항상 성공해서 단계 전체가 성공으로 끝남concurrency설정이 없어 연달아 머지하면 같은 서버에 배포 두 건이 동시에 컨테이너를 교체변경 사항 (
.github/workflows/deploy.yml)concurrency추가 (group: deploy-prod,cancel-in-progress: false)main과develop푸시는 둘 다ENV_NAME=prod로 같은 서버에 배포하므로 그룹을 하나로 묶음docker compose up실패가 단계 실패로 전달됨exit로 반환.set -e를 추가해cd실패 등도 즉시 중단prune은 그대로 실행해서 디스크를 비움 (단순히set -e만 쓰면 실패 시 정리를 건너뛰어 다음 배포가 디스크 부족으로 막히기 쉬움)prune자체의 실패는 배포 결과에 영향을 주지 않도록|| true영향 / 주의
Run workflow로 다시 실행하세요.df -h /,docker system df). 도커 캐시·이미지 정리로 회수된 용량이 약 750MB뿐이라 다른 원인을 찾아야 함. DB 볼륨이 있을 수 있어docker volume prune,docker system prune --volumes는 사용하지 않음0f7482c38e11_humix-backend-prod컨테이너가 현재 서비스 중인지docker ps -a로 확인한 뒤 정리CI/CD Pipeline수동 실행으로 [Bug] 생성·구간 재생성 요청 API가 HTTP 202로 응답하도록 수정 (#38) #43, [Bug] 구간 재생성 반복 시 곡 이름이 30자를 넘어 500이 나는 문제 수정 (#44) #45, [Feat] SSE complete 결과에 root_generation_id 추가 (#46) #47 반영범위 외
humix-ai-cpu)까지 처음부터 다시 빌드해 디스크를 크게 쓰는 문제 (서버 디스크 크기 확인 후 별도 검토)develop푸시가 운영에 배포되는 점,@master로 고정된 액션 버전테스트
deploy.ymlYAML 문법 검증 (Ruby YAML 파서), 단계 7 스크립트sh -n문법 검사docker명령으로 스크립트 동작 검증 (종료 코드 /prune실행 횟수)up실패(17)prune실패docker compose없음 →docker-compose성공docker-compose실패(5)concurrency의 대기·대체 동작은 GitHub 문서 기준이고, 머지 후 연달아 머지해 확인이 필요합니다.🤖 Generated with Claude Code