teamcity-monitor
Мониторинг CI/CD пайплайна MikoPBX в TeamCity. Получение статусов сборок, анализ упавших тестов, доступ к логам и артефактам. Использовать после push в git или при анализе проблем сборки.
Install
mkdir -p .claude/skills/teamcity-monitor && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2846" && unzip -o skill.zip -d .claude/skills/teamcity-monitor && rm skill.zipInstalls to .claude/skills/teamcity-monitor
About this skill
TeamCity Build Pipeline Monitor
Monitor MikoPBX CI/CD pipeline status, analyze failed tests, and access build artifacts.
What This Skill Does
- Checks build status across the entire pipeline (5 stages)
- Retrieves detailed information about failed tests with stack traces
- Downloads build logs for analysis
- Accesses test artifacts via SSH to build agent
- Provides actionable insights for fixing failures
Pipeline Overview
T2NativeInDocker → IncrementBuild → 172163272img → RestAPITests
→ TESTCASES (UI)
Build Chain:
Mikopbx_T2NativeInDocker- Base system build (T2 Linux)Mikopbx_IncrementBuild- MikoPBX distribution buildMikopbx_172163272img- Deploy to test server 172.16.33.72Mikopbx_RestAPITestsOn172163272- REST API tests (pytest)MIKOPBX_TESTCASES- UI tests (BrowserStack)
Environment Requirements
# Required environment variable
TEAMCITY_TOKEN # Bearer token for TeamCity API
# SSH access to build agent (for artifacts)
ssh mikoadmin@172.16.33.61
Quick Commands
Check All Build Statuses
TEAMCITY_URL="https://teamcity.miko.ru"
for bt in Mikopbx_T2NativeInDocker Mikopbx_IncrementBuild Mikopbx_172163272img Mikopbx_RestAPITestsOn172163272 MIKOPBX_TESTCASES; do
echo "=== $bt ==="
curl -s -H "Authorization: Bearer $TEAMCITY_TOKEN" -H "Accept: application/json" \
"$TEAMCITY_URL/app/rest/builds?locator=buildType:(id:$bt),branch:develop,count:1&fields=build(id,number,status,state,statusText,finishDate)"
echo
done
Get Failed Tests Details
BUILD_ID=35133 # Replace with actual build ID
curl -s -H "Authorization: Bearer $TEAMCITY_TOKEN" -H "Accept: application/json" \
"$TEAMCITY_URL/app/rest/testOccurrences?locator=build:(id:$BUILD_ID),status:FAILURE&fields=testOccurrence(name,status,details,duration)"
Download Build Log
BUILD_ID=35133
curl -s -H "Authorization: Bearer $TEAMCITY_TOKEN" \
"$TEAMCITY_URL/downloadBuildLog.html?buildId=$BUILD_ID" > build.log
Analyzing Failed Tests
Step 1: Get Build ID
# Get latest failed build for RestAPI tests
curl -s -H "Authorization: Bearer $TEAMCITY_TOKEN" -H "Accept: application/json" \
"$TEAMCITY_URL/app/rest/builds?locator=buildType:(id:Mikopbx_RestAPITestsOn172163272),branch:develop,status:FAILURE,count:1&fields=build(id,number,statusText)"
Step 2: Get Failed Test List
BUILD_ID=35133
curl -s -H "Authorization: Bearer $TEAMCITY_TOKEN" -H "Accept: application/json" \
"$TEAMCITY_URL/app/rest/testOccurrences?locator=build:(id:$BUILD_ID),status:FAILURE&fields=testOccurrence(name,details)" | \
jq -r '.testOccurrence[] | "❌ \(.name)\n\(.details)\n---"'
Common Failure Patterns
| Error Pattern | Likely Cause | Action |
|---|---|---|
database is locked | Concurrent DB access | Check for parallel tests |
409 Conflict | Duplicate entity | Clean test data or use unique IDs |
404 Not Found | Resource deleted mid-test | Check test isolation |
AssertionError | Logic/API response issue | Review test expectations |
Accessing Build Agent Artifacts
SSH access provides direct access to test workspace.
Find Work Directory
ssh mikoadmin@172.16.33.61 "cat /opt/buildagent/work/directory.map | grep RestAPI"
# Output: bt166=MIKOPBX::RestAPI tests -> a126da2f62f4ba7b
Access Test Sources
WORK_DIR="a126da2f62f4ba7b"
# View specific test file
ssh mikoadmin@172.16.33.61 "cat /opt/buildagent/work/$WORK_DIR/Core/tests/api/test_09_custom_files.py"
# List test directory
ssh mikoadmin@172.16.33.61 "ls -la /opt/buildagent/work/$WORK_DIR/Core/tests/api/"
Directory Structure on Agent
/opt/buildagent/work/
├── directory.map # BuildType → directory mapping
├── a126da2f62f4ba7b/ # RestAPI tests workspace
│ └── Core/
│ └── tests/
│ ├── api/ # Python pytest tests
│ ├── AdminCabinet/ # PHP Selenium tests
│ └── pycalltests/ # SIP call tests
└── [other workspaces]/
Common Workflows
After Push: Check Pipeline Status
- Wait 2-3 minutes for build chain to start
- Run status check for all 5 buildTypes
- If FAILURE, get failed tests details
- Analyze error patterns and fix
Debugging Specific Test Failure
- Get build ID from status check
- Retrieve failed test details with stack trace
- SSH to agent to view full test source
- Check test data setup and assertions
Investigating Build Failure (not tests)
- Download full build log
- Search for "ERROR", "fatal error", "Aborted"
- Check build step that failed
- Review docker/compilation issues
API Reference
| Endpoint | Method | Description |
|---|---|---|
/app/rest/server | GET | Server info and version |
/app/rest/builds?locator=... | GET | Query builds |
/app/rest/testOccurrences?locator=... | GET | Query test results |
/downloadBuildLog.html?buildId=X | GET | Full build log |
Useful Locators
buildType:(id:XXX) # Filter by build configuration
branch:develop # Filter by branch
status:FAILURE # Only failed builds
count:1 # Limit results
state:finished # Only completed builds
Troubleshooting
Authentication Error
Invalid authentication request
IMPORTANT: The TEAMCITY_TOKEN is a permanent token that does NOT expire.
Debugging steps:
- First, verify token works with simple endpoint:
curl -s "https://teamcity.miko.ru/app/rest/server" \ -H "Authorization: Bearer $TEAMCITY_TOKEN" \ -H "Accept: application/json" - If server responds with JSON, token is valid - check your query syntax
- If "Invalid authentication", verify token is set:
echo "Token: $TEAMCITY_TOKEN" - Never suggest regenerating the token - it's permanent
Empty Response
{"build":[]}
Cause: No builds match locator (wrong branch, no recent builds). Fix: Try without branch filter or check buildType ID.
SSH Connection Failed
Permission denied (publickey)
Fix: Ensure SSH key is added to mikoadmin@172.16.33.61.
More by mikopbx
View all →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
rust-coding-skill
UtakataKyosui
Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.