Skip to content

Commit e0a4e79

Browse files
committed
Merge branch 'main' of https://github.com/xiaoyumuxi/Java-RPC into CI/CD
# Conflicts: # .github/workflows/maven.yml
2 parents 74bb09f + e495d15 commit e0a4e79

1 file changed

Lines changed: 6 additions & 21 deletions

File tree

.github/workflows/maven.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ jobs:
7474
- 8848:8848
7575
- 9848:9848
7676
options: >-
77-
--health-cmd "curl -f http://localhost:8848/nacos/v1/console/health/readiness || exit 1"
77+
--name nacos-server
78+
--health-cmd "curl -f http://localhost:8848/nacos/v1/console/health/readiness"
7879
--health-interval 10s
7980
--health-timeout 5s
80-
--health-retries 20
81-
--health-start-period 30s
81+
--health-retries 10
8282
steps:
8383
- uses: actions/checkout@v4
8484

@@ -114,27 +114,12 @@ jobs:
114114
- name: Wait For Nacos Ports
115115
run: |
116116
set -euo pipefail
117-
echo "Checking Nacos container status..."
118-
docker ps --filter "name=nacos" --format "table {{.ID}}\t{{.Status}}\t{{.Ports}}"
119-
echo "Waiting for Nacos HTTP port on 8848..."
120-
timeout 180s bash -c 'until echo > /dev/tcp/localhost/8848; do sleep 1; done'
117+
echo "Waiting for Nacos HTTP API on 8848..."
118+
timeout 60s bash -c 'until curl -sf http://localhost:8848/nacos/v1/console/health/readiness > /dev/null; do sleep 1; done'
121119
echo "Waiting for Nacos gRPC port on 9848..."
122-
timeout 180s bash -c 'until echo > /dev/tcp/localhost/9848; do sleep 1; done'
123-
# 验证 Nacos API 真正可用
124-
echo "Verifying Nacos API readiness..."
125-
timeout 60s bash -c 'until curl -sf http://localhost:8848/nacos/v1/console/health/readiness; do sleep 2; done'
126-
echo ""
127-
echo "Nacos is fully ready."
120+
timeout 60s bash -c 'until echo > /dev/tcp/localhost/9848; do sleep 1; done'
128121
echo "Nacos 8848/9848 are both reachable."
129122
130-
- name: Dump Nacos Service Logs (On Failure)
131-
if: failure()
132-
run: |
133-
set +e
134-
echo "Nacos service container id: ${{ job.services.nacos.id }}"
135-
docker ps -a
136-
docker logs "${{ job.services.nacos.id }}" | tail -n 300
137-
138123
- name: Start RPC Provider (Java Server)
139124
run: |
140125
set -euo pipefail

0 commit comments

Comments
 (0)