Compare commits
2 Commits
9d71da01f9
...
784ca17072
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
784ca17072 | ||
|
|
f0ed0f366d |
@ -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
|
||||
|
||||
@ -9,7 +9,7 @@ const BASE_URL = import.meta.env.PROD
|
||||
|
||||
// Log Center 配置
|
||||
const LOG_CENTER_URL = import.meta.env.VITE_LOG_CENTER_URL || 'https://qiyuan-log-center-api.airlabs.art';
|
||||
const LOG_CENTER_ENABLED = import.meta.env.VITE_LOG_CENTER_ENABLED !== 'false';
|
||||
const LOG_CENTER_ENABLED = import.meta.env.VITE_LOG_CENTER_ENABLED === 'true' || (import.meta.env.PROD && import.meta.env.VITE_LOG_CENTER_ENABLED !== 'false');
|
||||
|
||||
/**
|
||||
* 上报错误到 Log Center
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user