Integrating TeamCity with Mergify
How to automate your TeamCity workflow using Mergify.
TeamCity is a popular Continuous Integration (CI) tool used for automating tasks such as building, testing, and deploying software. On the other hand, Mergify is a powerful tool that helps automate GitHub workflows. By integrating the two, you can create a well-oiled CI/CD pipeline that will increase your productivity and efficiency.
Prerequisites
Section titled PrerequisitesBefore you start, make sure that you have:
-
A GitHub account;
-
A repository for which you have admin permissions with Mergify installed;
-
A TeamCity account.
Using TeamCity Status Checks in Mergify Configuration
Section titled Using TeamCity Status Checks in Mergify ConfigurationOnce TeamCity reports status checks to GitHub, they can be used as conditions in your Mergify rules. Here’s a simple example:
pull_request_rules:
- name: Automatically merge when TeamCity build succeeds
conditions:
- check-success = TeamCity # Change this to match your TeamCity check name
- "#approved-reviews-by >= 1"
actions:
merge:
method: merge
In this example, Mergify will automatically merge pull requests that have at least one approved review and a successful TeamCity build.
Further Configuration
Section titled Further ConfigurationThe possibilities of integrating TeamCity with Mergify are extensive. For instance, you could use Mergify to:
-
Automatically update a PR when a build fails;
-
Apply labels, request reviewers, or post comments based on the results of status checks.
We encourage you to explore Mergify’s conditions and actions to create your personalized workflow.