mirror of
https://github.com/imjasonh/git-k8s
synced 2026-07-11 07:59:39 +00:00
Improve e2e Gitea initialization robustness
- Add explicit API readiness check inside the pod before running admin commands (readiness probe alone may pass before DB is ready) - Split "Initialize Gitea" into separate steps for better failure diagnostics: "Create Gitea admin user" and "Create test repository" https://claude.ai/code/session_01QfFzqKQUsxxBsiZUhuJ3pG
This commit is contained in:
parent
6db30c9fe3
commit
de30422c67
1 changed files with 17 additions and 5 deletions
22
.github/workflows/ci.yaml
vendored
22
.github/workflows/ci.yaml
vendored
|
|
@ -153,11 +153,22 @@ jobs:
|
|||
EOF
|
||||
|
||||
- name: Wait for Gitea
|
||||
run: kubectl rollout status deployment/gitea -n git-system --timeout=120s
|
||||
|
||||
- name: Initialize Gitea
|
||||
run: |
|
||||
# Create admin user.
|
||||
kubectl rollout status deployment/gitea -n git-system --timeout=120s
|
||||
# Wait for Gitea API to be fully responsive inside the pod.
|
||||
for i in $(seq 1 30); do
|
||||
if kubectl exec -n git-system deploy/gitea -- \
|
||||
curl -sf http://localhost:3000/api/v1/version; then
|
||||
echo ""
|
||||
echo "Gitea API is ready"
|
||||
break
|
||||
fi
|
||||
echo "Waiting for Gitea API (attempt $i)..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
- name: Create Gitea admin user
|
||||
run: |
|
||||
kubectl exec -n git-system deploy/gitea -- \
|
||||
gitea admin user create \
|
||||
--admin \
|
||||
|
|
@ -166,7 +177,8 @@ jobs:
|
|||
--email admin@test.local \
|
||||
--must-change-password=false
|
||||
|
||||
# Create test repository with an initial commit on main.
|
||||
- name: Create test repository
|
||||
run: |
|
||||
kubectl exec -n git-system deploy/gitea -- \
|
||||
curl -sf -X POST http://localhost:3000/api/v1/user/repos \
|
||||
-H 'Content-Type: application/json' \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue