MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

TeamCity Meta-Runners Guide: Reusable Build Steps vs Build Templates

Originally published on 2015-02-24; fully revised and updated.

TeamCity Meta-Runners let you package repeated build logic into reusable runner types. If you maintain multiple build configurations and keep copying the same steps, this pattern helps you centralize those steps, expose only the parameters that vary, and keep your CI setup easier to maintain.

Build configuration templates in TeamCity

What Meta-Runners solve in TeamCity

Standard build runners are convenient, but teams often end up duplicating identical step sequences across many build configurations. Meta-Runners address this by turning existing build steps into a reusable custom runner. You can then add that custom runner wherever needed instead of recreating the same commands repeatedly.

Templates vs Meta-Runners vs command-line steps

These options are related, but they solve different reuse problems:

OptionBest forReuse scopeKey limitation
Build configuration templateStandardizing mostly similar build configurationsWhole configuration baselineA build configuration can be based on only one template
Meta-RunnerReusing one or more repeated build stepsBuild-step level across many configurationsNeeds deliberate parameter design to stay generic
Command-line runner onlyQuick one-off scriptsSingle step in a single configurationDuplication and drift when copied across projects

Convert a fixed deploy command into a reusable step

The original example starts with a command-line runner that deploys to one specific Heroku remote:

git remote add heroku git@heroku.com:django-ci-example.git
git push heroku master

To make this reusable, extract the remote URL into a TeamCity parameter:

git remote add heroku %heroku.remote%
git push heroku masterCode language: CSS (css)

You then provide %heroku.remote% in the build parameters for each consuming build configuration.

Extraction and reuse workflow

In the original TeamCity flow, you parameterize the step first, then use Extract Meta-Runner from the build configuration settings.

flowchart TD
    A[Open build configuration] --> B[Parameterize fixed values]
    B --> C[Validate command line step]
    C --> D[Click Extract Meta-Runner]
    D --> E[Name and save Meta-Runner]
    E --> F[Open another build configuration]
    F --> G[Add build step with Meta-Runner type]
    G --> H[Set heroku.remote value]
    H --> I[Run build and verify]
  • Create or update the original build step so variable values are parameters.
  • Extract a Meta-Runner from that build configuration.
  • Edit the generated Meta-Runner if you want fewer parameters or steps.
  • Add the Meta-Runner as a normal runner type in other build configurations.
Extract Meta-Runner dialog in TeamCity
Extract Meta-Runner dialog from the original walkthrough.

Using the Meta-Runner in other build configurations

After extraction, the new runner appears in the Runner type list when adding build steps. When selected, the exposed parameter fields (for example, heroku.remote) can be set per build configuration. This preserves step behavior while removing copy-paste maintenance.

Meta-Runner available in TeamCity runner type list
The extracted Meta-Runner becomes selectable like any built-in runner type.

A useful detail from the original guide: a Meta-Runner is stored as XML and can be edited in TeamCity. You can remove default parameter values if you want users to provide explicit values each time.

Security and maintainability notes

The original article notes that deploying to Heroku through git remotes requires SSH keys on the agent, and that this example is primarily instructional rather than an ideal production deployment pattern. Treat runner extraction as the key concept, and apply your organization’s secret-handling and deployment controls.

Original references preserved from the source material: Chapter 3, Chapter 6, and heroku-headless.

Common pitfalls

  • Leaving environment-specific values hardcoded instead of parameterized.
  • Using a template when only step-level reuse is needed.
  • Extracting too many unrelated steps into one Meta-Runner.
  • Keeping risky default parameter values that are easy to forget to override.
  • Ignoring agent prerequisites such as SSH key availability for git-based deploys.

Attribution: Based on the original DevOpsSchool post and its referenced material from Learning Continuous Integration with TeamCity.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

TeamCity Meta-Runners: Reuse Build Steps with Parameterized Runner Types

Meta-Runners in TeamCity help you package repeated build steps into reusable, parameterized runner types. This guide shows when to use them, how to extract one, and how to apply it safely across build configurations.

Read More

Continuous Integration Training Blueprint for .NET Teams (MSBuild, TeamCity, NUnit, NCover, FxCop, Web Deploy)

This revised guide converts an older CI course announcement into a practical training blueprint for build and release teams. It maps each tool to the pipeline, shows a workflow diagram, and includes realistic command-line examples for labs.

Read More

TeamCity Training Curriculum: CI/CD Course Outline, Labs, and Delivery Formats

A structured, practical rewrite of the original TeamCity training post for DevOps and build/release teams. Use it to evaluate course scope, delivery model, lab depth, and tooling coverage before enrolling.

Read More

Bamboo vs TeamCity vs CruiseControl: Historical CI Comparison and Practical Evaluation Guide

This revised guide turns a brief 2010 comparison into a structured, engineering-focused reference. It preserves the original claims, adds a CI workflow diagram, and provides a practical checklist for modern tool evaluation.

Read More

Embracing the Future of Technology: Training, Certifications, and Digital Transformation

Technology continues to redefine how we work, communicate, and deliver value. From DevOps to MLOps, from healthcare tech platforms to blogging strategies, the modern digital ecosystem is…

Read More

What is TeamCity and How it works? An Overview and Its Use Cases

History & Origin of TeamCity TeamCity is a build management and continuous integration server from JetBrains. It was first released on October 2, 2006, and is commercial…

Read More
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
1 month ago

TeamCity meta-runners are useful for turning repeated build steps into reusable, consistent workflows. They can reduce duplication when several projects share the same build or test process. Clear parameter names and simple documentation make these runners easier for teammates to reuse correctly. Before changing a shared meta-runner, test it on a sample configuration to catch unexpected effects. This helps teams keep pipelines maintainable as projects grow.

Rohit Gupta
Rohit Gupta
1 month ago

As TeamCity templates become shared across multiple projects, managing changes without disrupting existing builds can be tricky. A small modification to a common template may affect dozens of pipelines with different requirements. Testing template updates against representative projects, documenting parameter changes, and maintaining a clear rollback strategy can help teams introduce improvements without creating unexpected build failures.

2
0
Would love your thoughts, please comment.x
()
x