Triggering a Custom Build
Last modified: 20 April 2023A build configuration usually has Configuring Build Triggers configured in it which automatically start new build each time the conditions are met, like scheduled time, or detection of VCS changes are detected, etc. However TeamCity allows to trigger a build manually whenever you need, and customize this build by adding properties, using specific changes, running the build on specific agent, etc.
There are several ways of launching a custom build in TeamCity:
Click the ellipsis on the Run button, and specify the options in the Run Custom Build dialog described runCustomBuild.
To run a custom build with specific changes, open build results page, go to the Changes tab, expand the required change and click the Run build with this change and proceed with the runCustomBuild in the Run Custom Build dialog.
Use Accessing Server by HTTP to TeamCity to trigger a build
Option | Description |
---|---|
Agent | Select an agent you want to run the build on from the drop-down list. Note, that for each agent in the list, TeamCity displays its current state, and estimates when the agent will become idle, if it runs a build at the moment. Besides the possibility to run a build on a particular agent from the list, you can also use one of the following options:
|
Artifact dependencies | This option is available only for builds that have artifact dependencies on other builds. Specify the build from which the artifacts should be taken for the custom build. |
System properties/ Environment variables | By default, these sections show system properties and environment variables currently defined for the build configuration. You can add new, edit, and delete additional properties/variables, or edit values of predefined ones. These settings are available only if you have permissions to change system properties and environment variables for the build configuration. When adding/editing/deleting properties and variables, note the following:
|
Include changes | The section allows you to specify a particular change to be included to the build. The build will use the change's revision to checkout the sources. That is, all the changes up to the selected one will be included into the build. Please note, that TeamCity displays only the changes earlier detected by TeamCity for the current build configuration VCS roots. If the VCS root was detached from the build configuration since the change occurred, there is no ability to run the build on such change. A limited number of changes is displayed. If there is an earlier change in TeamCity that you need to run build on, you can locate the change in the Change Log and use Run build with this change action. This section is available only if you have permissions to access VCS roots for the build configuration. |
Latest changes on the moment of build start | Default option. TeamCity will automatically include all changes available for the moment. |
All changes up to the selected one | When you select a change in the drop-down list, TeamCity runs the build with the selected change and all changes that were made before it. |
Build comment | Add optional comment to the build. |
Run as personal build | Select this option to run this custom build as a Personal Build one. |
Put build to the queue top | Select this option to put the build to the top position in the Build Queue. |
Run Build | Click to run build with specified parameters. |
note
Please note that a greater build number does not mean more recent changes and the last build in the builds history does not reflect the state of the latest project sources.
warning
Builds in the builds history are sorted by their start time, not by changes they include.
To create history builds, TeamCity always uses the VCS roots and settings that are now actual for the particular build configuration. If you delete a VCS root from the build configuration, you can no longer trigger history builds with changes which the root contained.
Thanks for your feedback!