-
Notifications
You must be signed in to change notification settings - Fork 0
[REFACTOR] 코드 구조 리팩토링 #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
65cbd40
b05fa5e
5768b02
a0565b5
4f9a687
0cbb342
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: CD INTERNAL PROD | ||
| name: CD PROD | ||
|
|
||
| on: | ||
| push: | ||
|
|
@@ -18,24 +18,33 @@ jobs: | |
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Grant execute permission for run-test-mysql.sh | ||
| run: chmod +x run-test-mysql.sh | ||
| working-directory: ./domain | ||
| - name: Start test containers | ||
| run: docker compose -f test-docker-compose.yml up -d | ||
|
|
||
| - name: Grant execute permission for run-test-redis.sh | ||
| run: chmod +x run-test-redis.sh | ||
| working-directory: ./common | ||
|
|
||
| - name: Run test mysql script | ||
| run: ./run-test-mysql.sh | ||
| working-directory: ./domain | ||
|
|
||
| - name: Run test redis script | ||
| run: ./run-test-redis.sh | ||
| working-directory: ./common | ||
|
|
||
| - name: Test & Build internal only | ||
| run: ./gradlew :internal:build | ||
| - name: Wait for MySQL to be ready | ||
| run: | | ||
| for i in $(seq 1 30); do | ||
| if docker exec payment-test-mysql mysqladmin ping -h localhost --silent 2>/dev/null; then | ||
| echo "MySQL is ready" | ||
| break | ||
| fi | ||
| echo "Waiting for MySQL... ($i/30)" | ||
| sleep 2 | ||
| done | ||
|
|
||
| - name: Wait for Redis to be ready | ||
| run: | | ||
| for i in $(seq 1 30); do | ||
| if docker exec payment-test-redis redis-cli ping 2>/dev/null | grep -q PONG; then | ||
| echo "Redis is ready" | ||
| break | ||
| fi | ||
| echo "Waiting for Redis... ($i/30)" | ||
| sleep 2 | ||
| done | ||
|
|
||
| - name: Test & Build | ||
| run: ./gradlew build | ||
|
Comment on lines
+21
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 레디니스 타임아웃 후에도 성공으로 진행됨 현재 루프는 준비되지 않아도 종료 후 다음 단계로 진행합니다. 서비스가 기동되지 않은 상태에서 테스트/빌드 및 이미지 푸시가 수행될 수 있어 CI 신뢰성이 떨어집니다. 타임아웃 시 명시적으로 실패 처리하세요. 🛠️ 타임아웃 시 실패 처리 추가 - name: Wait for MySQL to be ready
run: |
- for i in $(seq 1 30); do
+ ready=0
+ for i in $(seq 1 30); do
if docker exec payment-test-mysql mysqladmin ping -h localhost --silent 2>/dev/null; then
echo "MySQL is ready"
+ ready=1
break
fi
echo "Waiting for MySQL... ($i/30)"
sleep 2
done
+ if [ "$ready" -ne 1 ]; then
+ echo "MySQL did not become ready in time"
+ exit 1
+ fi
- name: Wait for Redis to be ready
run: |
- for i in $(seq 1 30); do
+ ready=0
+ for i in $(seq 1 30); do
if docker exec payment-test-redis redis-cli ping 2>/dev/null | grep -q PONG; then
echo "Redis is ready"
+ ready=1
break
fi
echo "Waiting for Redis... ($i/30)"
sleep 2
done
+ if [ "$ready" -ne 1 ]; then
+ echo "Redis did not become ready in time"
+ exit 1
+ fi🤖 Prompt for AI Agents |
||
|
|
||
| - name: Sign in Dockerhub | ||
| uses: docker/login-action@v3 | ||
|
|
@@ -45,11 +54,9 @@ jobs: | |
|
|
||
| - name: Build the Docker image | ||
| run: docker build -f ./Dockerfile --platform linux/arm64 --no-cache -t samhap/kokomen-payment-internal:prod . | ||
| working-directory: ./internal | ||
|
|
||
| - name: Push the Docker Image to Dockerhub | ||
| run: docker push samhap/kokomen-payment-internal:prod | ||
| working-directory: ./internal | ||
|
|
||
| deploy-internal: | ||
| needs: build-internal | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레디니스 타임아웃 후에도 성공으로 진행됨
현재 루프는 준비되지 않아도 종료 후 다음 단계로 진행합니다. 서비스가 기동되지 않은 상태에서 테스트/빌드 및 이미지 푸시가 수행될 수 있어 CI 신뢰성이 떨어집니다. 타임아웃 시 명시적으로 실패 처리하세요.
🛠️ 타임아웃 시 실패 처리 추가
- name: Wait for MySQL to be ready run: | - for i in $(seq 1 30); do + ready=0 + for i in $(seq 1 30); do if docker exec payment-test-mysql mysqladmin ping -h localhost --silent 2>/dev/null; then echo "MySQL is ready" + ready=1 break fi echo "Waiting for MySQL... ($i/30)" sleep 2 done + if [ "$ready" -ne 1 ]; then + echo "MySQL did not become ready in time" + exit 1 + fi - name: Wait for Redis to be ready run: | - for i in $(seq 1 30); do + ready=0 + for i in $(seq 1 30); do if docker exec payment-test-redis redis-cli ping 2>/dev/null | grep -q PONG; then echo "Redis is ready" + ready=1 break fi echo "Waiting for Redis... ($i/30)" sleep 2 done + if [ "$ready" -ne 1 ]; then + echo "Redis did not become ready in time" + exit 1 + fi🤖 Prompt for AI Agents