File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,13 @@ jobs:
225225 working-directory : /
226226 comment : Deploy
227227 command : |
228+ set -xe
229+ echo "===== 현재 실행 중인 컨테이너 ====="
230+ docker ps -a || true
231+
232+ echo "===== 기존 컨테이너 종료 & 제거 ====="
233+ docker stop app1 2>/dev/null || true
234+ docker rm app1 2>/dev/null || true
228235 # EC2 내부에서 prod.env 파일 생성
229236 cat > /home/ec2-user/prod.env << 'EOF'
230237 SPRING_PROFILES_ACTIVE=prod
@@ -254,7 +261,11 @@ jobs:
254261 --network common \
255262 -p 8080:8080 \
256263 ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/${{ env.DOCKER_IMAGE_NAME }}:latest
257-
264+ echo "===== 새 컨테이너 로그 출력 ====="
265+ sleep 5
266+ docker logs --tail=100 app1 || true
267+
268+ echo "===== 배포 완료 ====="
258269 # dangling image 정리 + .env 삭제
259270 docker rmi $(docker images -f "dangling=true" -q) || true
260271 rm -f /home/ec2-user/prod.env
You can’t perform that action at this time.
0 commit comments