What CI/CD actually solves, where TeamCity fits in the landscape, how the server-agent-database architecture works, and the key terms you need before touching the UI
Before the era of CI, developers worked in long-lived branches for weeks or months, then merged everything at once — the dreaded "integration hell." CI/CD solves this by automating the feedback loop: every commit triggers a build and test run, so failures are discovered within minutes, not weeks.
Automatically build and test code on every commit. Goals:
Extend CI so that a passing build automatically produces a deployable artifact — and optionally deploys it to staging or production. Goals:
TeamCity is a commercial CI/CD server by JetBrains. It competes with Jenkins (open-source), CircleCI (cloud), GitLab CI (built-in), and GitHub Actions. Each has trade-offs:
| Feature | TeamCity 2017.2 | Jenkins | CircleCI | GitLab CI |
|---|---|---|---|---|
| Hosting | Self-hosted | Self-hosted | Cloud / self-hosted | Cloud / self-hosted |
| UI quality | Excellent | Dated (pre-Blue Ocean) | Good | Good |
| Build chain visualization | Built-in, visual | Plugin required | Workflow YAML | Pipeline YAML |
| Agent model | Pull-based agents | Push + pull | Docker containers | Runners |
| Config as code | Kotlin DSL (2017+) | Jenkinsfile (Groovy) | YAML | YAML |
| License | Free: 3 agents, 100 configs | Free / open-source | Paid tiers | Free tier + paid |
| Plugin ecosystem | Good (JetBrains-curated) | Huge (1800+ plugins) | Orbs | Built-in heavy |
| Best for | JVM teams, .NET teams | Any — highly flexible | Cloud-native teams | GitLab users |
TeamCity Professional is free for up to 3 build agents and 100 build configurations. This is sufficient for most small-to-medium teams. Enterprise license removes these limits and adds advanced features (LDAP, 2FA, more agent types).
TeamCity has three distinct components that work together. Understanding this prevents configuration mistakes later.
Runs as a Java web application (Tomcat-based). Responsibilities:
Stores build history, user accounts, statistics, and runtime data. The project/build configuration is also mirrored here from XML files. Never share a database between two TeamCity servers.
A file-system directory (default: ~/.BuildServer on Linux, %USERPROFILE%\.BuildServer on Windows). Contains:
config/ — project and build configuration XML filessystem/artifacts/ — published build artifactssystem/caches/ — VCS caches, agent cacheslogs/ — server and agent logsplugins/ — installed plugins (.zip files)Separate Java processes that run build steps. Key facts:
The TeamCity server does not run build steps — it only orchestrates. Never install your build tools (Maven, Node, Docker) on the server machine alone and expect builds to work. Build tools must be installed on the agent machines.
These terms appear everywhere in TeamCity. Get them clear before proceeding.
Version 2017.2 (released November 2017) introduced several important features this tutorial covers in detail:
| Feature | What it does | Covered in |
|---|---|---|
| Two-factor authentication | TOTP-based 2FA for all users | Phase 13 |
| Pull Request build feature | Auto-detects and builds GitHub/Bitbucket PRs | Phase 5, Phase 10 |
| Kotlin DSL versioned settings | Store all project config as Kotlin code in VCS | Phase 11, Phase 15 |
| Composite build configurations | Fan-in/fan-out build chains with aggregated results | Phase 9 |
| Docker support build feature | Docker login/logout, image cleanup after build | Phase 10 |
| Improved REST API (v10) | New endpoints, better filtering, build chain API | Phase 14 |
| Shared resources | Lock/semaphore for exclusive resource access | Phase 10 |
The .2 in 2017.2.2 is a bugfix release. All major feature content in this tutorial applies to the full 2017.2.x line. The build number for 2017.2.2 is 51985. You can verify your version at Administration → Server Administration → Server Info.
This is the lifecycle of a single build, from the developer's commit to a published artifact:
Total elapsed time from push to notification: typically 2–8 minutes for a Java project, depending on build duration and queue wait time.
If you have an existing build script, here's how its pieces map to TeamCity concepts:
| In your script / workflow | TeamCity equivalent |
|---|---|
git clone https://github.com/org/repo | VCS Root — defines the repo URL and credentials |
git checkout feature-branch | Branch specification on the VCS Root |
export VERSION=1.2.3 | Environment variable parameter on build config |
mvn clean package | Build step with Maven runner |
cp target/app.jar /artifacts/ | Artifact paths: target/app.jar |
if [ $? -ne 0 ]; then notify; fi | Failure condition + notification rule |
| Cron job: run nightly at 02:00 | Schedule trigger with cron expression |
| Run on every push to main | VCS trigger on branch refs/heads/main |
| Deploy only if tests pass | Snapshot dependency: Deploy config depends on Test config |
TeamCity doesn't replace your build tool (Maven, Gradle, npm). It orchestrates them — triggering them at the right time, on the right machine, with the right parameters, and collecting their results. Your pom.xml or build.gradle stays exactly as is.