feat(ops): add CI/CD failure reporting to Log Center
All checks were successful
Build and Deploy Web / build-and-deploy (push) Successful in 3m2s
All checks were successful
Build and Deploy Web / build-and-deploy (push) Successful in 3m2s
Report build/deploy failures to Log Center with source: cicd Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f0ed0f366d
commit
784ca17072
@ -73,3 +73,34 @@ jobs:
|
||||
else
|
||||
kubectl rollout restart deployment/rtc-web-dev
|
||||
fi
|
||||
|
||||
- name: Report failure to Log Center
|
||||
if: failure()
|
||||
run: |
|
||||
curl -s -X POST "https://qiyuan-log-center-api.airlabs.art/api/v1/logs/report" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"project_id\": \"rtc_web\",
|
||||
\"environment\": \"${{ github.ref_name }}\",
|
||||
\"level\": \"ERROR\",
|
||||
\"source\": \"cicd\",
|
||||
\"commit_hash\": \"${{ github.sha }}\",
|
||||
\"repo_url\": \"https://gitea.airlabs.art/zyc/rtc_web.git\",
|
||||
\"error\": {
|
||||
\"type\": \"CICDFailure\",
|
||||
\"message\": \"Build and Deploy failed on branch ${{ github.ref_name }}\",
|
||||
\"stack_trace\": [
|
||||
\"Repository: ${{ github.repository }}\",
|
||||
\"Branch: ${{ github.ref_name }}\",
|
||||
\"Commit: ${{ github.sha }}\",
|
||||
\"Run ID: ${{ github.run_id }}\",
|
||||
\"Actor: ${{ github.actor }}\"
|
||||
]
|
||||
},
|
||||
\"context\": {
|
||||
\"workflow\": \"${{ github.workflow }}\",
|
||||
\"run_id\": \"${{ github.run_id }}\",
|
||||
\"branch\": \"${{ github.ref_name }}\",
|
||||
\"actor\": \"${{ github.actor }}\"
|
||||
}
|
||||
}" || true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user