Creating and Editing Build Configurations
This page details creating build configurations via the TeamCity web UI. Other options include the REST API and using TeamCity project configuration in DSL based on the Kotlin language.
To create a build configuration, open General Settings of a project and click Create build configuration under the Build Configurations section.
TeamCity provides several ways to create a new build configuration for a project:
You can create a new build configuration
- Manually
- Pointing to a repository URL
Pointing to a GitHub repository
Pointing to Bitbucket repository
Create a build configuration template, and then create a build configuration based on the template.
When build configurations are created, you can:
- change their order
- edit their settings
control them via the Actions menu
Creating New Build Configuration Manually
On the Administration > Projects page, select the desired project in the list. (Alternatively, open the project using the Projects popup, and click the Edit Project Settings link on the right). The Project Settings page opens.
On the Project Settings page, Build Configurations section, click Create build configuration.
In the Create Build Configuration dialog, specify the name, ID and (optionally) description for the build configuration, click Create.
- Proceed with creating other settings:
- Create/edit VCS roots and specify VCS-specific settings
On the Build Steps page, configure build steps discovered by the automatic detection. To create them manually by selecting a desired build runner from the drop-down menu. Click Save. You can add as many build steps as you need within one build configuration. Note that they will be executed sequentially. In the end, the build gets the merged status and the output goes into the same build log. If some step fails, the rest is executed or not, depending on their step execution policy.
Additionally, configure build triggering options, dependencies, properties and variables, and agent requirements.
Creating New Build Configuration from URL
You can create a build configuration using a VCS URL:
On the Administration > Projects page, select the desired project in the list. (Alternatively, open the project using the Projects pop-up menu, and click Edit Project Settings on the right). The Project Settings page opens.
On the Project Settings page, Build Configurations section, click Create build configuration from URL.
In the Create Build Configuration dialog, specify a VCS repository URL and, if authentication is required, VCS credentials (username and password/token). Click Create.
TeamCity will suggest the build configuration name and will configure the rest of settings for you.
It will determine the type of the VCS repository and create a VCS root. For a Git repository, it will autodetect the default branch. You have an option to change it now or later, in the VCS root settings. You can also change the branch specification: by default, TeamCity monitors all branches of the repository but you can choose what exact branches to monitor by entering custom rules.
It will attempt to autodetect build steps: Ant, NAnt, Gradle, Maven, MSBuild, Visual Studio solution files, PowerShell, Xcode project files, Rake, and IntelliJ IDEA projects. If none found, you will have to configure build steps manually.
Next, TeamCity UI will display suggestion icons with prompts to create build triggers, failure conditions, and build features. Depending on the build configuration settings, it may suggest some additional configuration options.
After the build configuration is created, you can run a build and/or tweak the settings.
Creating New Build Configuration pointing to GitHub.com repository
- Click the Create build configuration button and select Pointing to GitHub.com repository.
If you do not have a GitHub connection configured, you will be redirected to the Connections page. Set up the connection as described here, then follow the steps below.
If you have a GitHub connection configured, follow the steps below.
On the Create Build Configuration From GitHub page, select a repository. TeamCity will verify the repository connection. If the connection is verified, the new page opens.
TeamCity will display the project and build configuration name. If required, modify the names.
It will also autodetect the default branch. You have an option to change it now or later, in the VCS root settings. You can also change the branch specification: by default, TeamCity monitors all branches of the repository but you can choose what exact branches to monitor by entering custom rules.
Click Proceed.TeamCity will add a VCS build trigger and attempt to autodetect build steps: Ant, NAnt, Gradle, Maven, MSBuild, Visual Studio solution files, PowerShell, Xcode project files, Rake, and IntelliJ IDEA projects. On the Auto-detected Build Steps page, select the step(s) to use in your build configuration. Click Use selected. If no steps found, you will have to configure build steps manually.
Your project and a build configuration are configured. Click Run to start the build. Depending on the build configuration settings, TeamCity can suggest some additional configuration options. Review the suggested settings and configure required ones.
Creating New Build Configuration pointing to Bitbucket Cloud
Click the Create build configuration button and select Pointing to Bitbucket Cloud repository.
If you do not have a Bitbucket connection configured, you will be redirected to the Connections page. Set up the connection as described here, then follow the steps below.
If you have a Bitbucket connection configured, follow the steps below.
On the Create Build Configuration From Bitbucket Cloud page, select a repository. TeamCity will verify the repository connection. If the connection is verified, the new page opens.
TeamCity will display the project and build configuration name. If required, modify the names.
For a Git repository, it will also autodetect the default branch. You have an option to change it now or later, in the VCS root settings. You can also change the branch specification: by default, TeamCity monitors all branches of the repository but you can choose what exact branches to monitor by entering custom rules.
Click Proceed.TeamCity will add a VCS build trigger and attempt to autodetect build steps: Ant, NAnt, Gradle, Maven, MSBuild, Visual Studio solution files, PowerShell, Xcode project files, Rake, and IntelliJ IDEA projects.
On the Auto-detected Build Steps page, select the step(s) to use in your build configuration. Click Use selected. If no steps found, you will have to configure build steps manually.Your project and a build configuration are configured. Click Run to start the build. Depending on the build configuration settings, TeamCity can suggest some additional configuration options. Review the suggested settings and configure required ones.
Creating Build Configuration Template
Creating a new build configuration template is similar to creating a new configuration:
On the Administration | Projects page, select the desired project in the list. (Alternatively, open the project using the Projects popup, and click the Edit Project Settings link on the right). The Project Settings page opens.
On the Project Settings page, Build Configuration Templates section, click the Create template button and proceed with configuring general settings, VCS settings, and build steps.
Alternatively, you can create a build configuration template from an existing build configuration:
Open the existing build configuration settings page, click Actions in the upper right corner of the screen, and select the Extract Template option.
Specify the settings required and click Create.
Creating Build Configuration From Template
To create a build configuration based on a template:
On the Administration | Projects page, select the desired project in the list. (Alternatively, open the project using the Projects popup, and click the Edit Project Settings link on the right). The Project Settings page opens.
On the Project Settings page, Build Configuration Templates section, locate the desired template and click its name or use Edit.
Click Actions in the upper right corner of the screen, and select Create Build Configuration.
Specify the required settings for the new configuration.
Alternatively, you can create a build configuration based on a template as follows:
On the Administration | Projects page, select the desired project from the list. (Alternatively, open the project using the Projects popup, and click the Edit Project Settings link on the right). The Project Settings page opens.
On the Project Settings page, Build Configurations section, click Create build configuration.
On the configuration settings page, use the Based on template drop-down menu and select a template for your build configuration.
Ordering Build Configurations
You can view all build configurations of a project on the Project Overview page listed in alphabetical order by default. Administrators can customize the default order.
Configuring Settings
When you select a build configuration from the list of build configurations, TeamCity displays the Build Configuration Home page where you can preview its recent build results. To access the build configuration's settings, click Edit Configuration Settings in the upper right corner of the screen.
Different build configuration settings are described in the respective articles inside this section.
Actions in Build Configuration Settings
Use the Actions menu, located in the upper right corner of the screen, when editing a build configuration to