TeamCity: Auto Trigger Build

Source: Internet
Author: User

Once you have created a build configuration, you can either manually click the "Run" button to trigger a build process, or you can automatically trigger the build process through the Triggers configuration. A trigger is a rule: start a build once an event occurs. TeamCity built-in support for multiple trigger types:

For the same build, we can apply multiple triggers that work independently of each other's logic. Below we have a detailed look at the use of various types of triggers.

VCS triggers

VCS triggers automatically trigger the build process when code changes are detected. TeamCity will detect changes in code based on the interval you set. If there are multiple checkin in this period, only one build is triggered.

It is important to note that when a build is configured with multiple VCs root, it does not trigger a build for each VCs root change, but does not determine whether to trigger a build until all VCS root has been detected.
You can also set each checkin to trigger a build. This requires selecting "Trigger a build on each check-in". If you want multiple commits of the same submitter to trigger only one build, put the "Include seral check-ins in a build if they is from the same committer" option.

The silent period (Quiet Period) is a more interesting concept. Setting does not trigger a build during successive checkin (these successive checkin are a complete process). In layman's words, a build is triggered once the last change has been detected and no new changes have been found in the default one-minute period.

There is another interesting thing in VCs triggers called "vcs Trigger Rules." By setting the rules, you can tell TeamCity if the condition that triggered the build is met:

Schedule Trigger

The Schedule trigger is needed when we want to trigger the build on a timed basis.

The simple way to use it is to select the appropriate time configuration in the date and times area. In addition TeamCity supports the CRON format time setting:

This gives us more flexibility.

Finish Build Trigger

If there is a dependency between builds, such as subsequent builds that rely on the product of the previous build, then the next build will be triggered when the previous build completes. The finish build trigger can do the job perfectly:

Just choose the right build configuration to do it. We can also decide whether to trigger the next build based on the success of the previous build:

Branch Remote Run Trigger

When we want to build a personal branch on TeamCity, we need to trigger the build through a change on a branch. Branch Remote Run triggers can be implemented with the following features:

We can specify a user's branch. Note that this trigger currently only supports git and mercurial.

TeamCity also supports some other types of triggers, which we'll cover in detail when we use them.

TeamCity: Auto Trigger Build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.