Space Details Key: TCD3 Name: TeamCity 3.x Documentation Description: This is JetBrains TeamCity 3.x reference documentation. Creator (Creation Date): pk (Jan 23, 2007) Last Modifier (Mod. Date): yaegor (Apr 09, 2008) Available Pages • TeamCity Documentation • TeamCityReference • _What's New in TeamCity 3.0 • What's New in TeamCity 3.1 • Concepts • Agent Requirements • Agent Working Directory • Authentication Scheme • Build Agent • Build Artifact • Build Checkout Directory • Build Configuration • Build Configuration State • Build Grid • Build History • Build Log • Build Numbering • Build Queue_ • Build Runner • Build State • Build Tag • Build Trigger • Build Working Directory • Change • Change State • Clean Sources • Clean-Up Policy • Code Coverage • Code Duplicates • Code Inspection • Continuous Integration • Dependent Build • Editions • Licensing Policy

Document generated by Confluence on Jun 16, 2008 13:43 Page 1 • Notification • Notification Conditions • Notification Rules • Notifier • Permission • Personal Build • Pinned Build • Pre-Tested (Delayed) Commit • Project • Remote Run • Responsibility • Role • RSS Feed • Run Configuration Policy • Security • Supported Platforms and Environments • TeamCity Data Directory • Testing Frameworks • User Account • VCS Root • Version Control System • Developing TeamCity Plugins • Agent Side Extensions • Plugin API FAQ • Server Side Extensions • Statistics customization • Typical Plugins • Web UI Extensions • Installation and Upgrade • Installation • Installing Additional Plugins • Installing and Configuring the TeamCity Server • Setting up and Running Additional Build Agents • Migrating to an External Database • Setting up an External Database • TeamCity Data Backup • Upgrade • Upgrade Notes • Installing Tools • Plugin • IntelliJ IDEA Plugin • Syndication Feed

Document generated by Confluence on Jun 16, 2008 13:43 Page 2 • Visual Studio Plugin • Windows Tray Notifier • System Administrator Reference • Configuring the Server • Accessing Server from Scripts • Authentication Settings • Build Script Interaction with TeamCity • Changing user password with default authentication scheme • Configuring Server URL • Configuring UTF8 Character Set for MySQL • Enabling Guest Login • Including Third-Party Reports in the Build Results • Mapping External Links in Comments • Using HTTPS to access TeamCity server • Enabling the Status Widget for Build Configurations • Enterprise License Expiration • Logs of Internal Events • Managing Projects • Assigning Build Configurations to Specific Build Agents • Configuring Artifact Dependencies • Configuring Build Runners • .NET Testing Frameworks Support • Additional Functionality in MSBuild Scripts • Ant_ • Maven2_ • NAnt_ • Sln2005_ • Sln2008_ • Configuring Build Triggers • Configuring VCS Settings • Creating and Editing Build Configurations • Notifier Templates Configuration • Patterns For Accessing Build Artifacts • System Properties for Running the Server • System Properties of a Build Configuration • Third-Party License Agreements • Troubleshooting • Known Issues • Reporting Issues • UI Reference • Administration • Build History Clean-Up Policy • Create Edit Build Configuration

Document generated by Confluence on Jun 16, 2008 13:43 Page 3 • 1.General Settings • 2.Version Control Settings • ClearCase • CVS • New Edit VCS Roots • Perforce • StarTeam • Subversion • Team Foundation Server • Visual Source Safe • 3.Build Runners • Ant • Duplicates Finder (.NET) • Duplicates Finder (Java) • Inspections • Ipr • Maven2 • MSBuild • NAnt • Simple Command Runner • sln2003 • sln2005 • sln2008 • 4.Build Triggering • Dependencies • Other Triggers • Schedule • Cron Expression Build Trigger • VCS Triggers • 5.Artifact Dependencies • 6.Properties and environment variables • 7.Agent Requirements • Create Edit Project • Licenses • Server Configuration • Email and Jabber Notifier Settings • User Accounts • Assign Roles • Edit General Settings of the User • VCS Roots • Agents • Agent Details • Build Configuration Home Page

Document generated by Confluence on Jun 16, 2008 13:43 Page 4 • Change Log • Compatible Agents • History • Overview • Pending Changes • Settings • Statistics • Build Queue • Build Results • Artifacts tab • Build Log tab • Changes tab • Code Coverage tab • Code Inspection tab • Dependencies tab • Duplicates tab • Overview tab • Tests tab • My Changes • My Settings And Tools • Feed URL Generator • Notifier Settings • Projects

Document generated by Confluence on Jun 16, 2008 13:43 Page 5 TeamCity Documentation

This page last changed on Feb 25, 2008 by yaegor. Welcome to TeamCity 3.x

TeamCity is a distributed build management and continuous integration system that allows your team to run and monitor your building process while improving team communication, productivity and the integration of changes. With TeamCity:

• the process of integrating changes becomes a core part of your daily activities, • integration problems are discovered even before the build is complete, • you are notified only about the events you are interested in, • the process of creating builds is quick and transparent.

TeamCity's basic unit of work is a software build. To build your software using TeamCity, you need to have at least one "Build Agent" - a build computer with a set of predefined parameters (such as system and environment variables, JDK version, etc). The build agents are arranged into a build grid. Each software build, in turn, has its own configuration - a set of actions and parameters specified for it. These include the build runner, build schedule, etc. The build agent must meet the builds configuration's requirements: if there is a free build agent that meets the build configuration requirements, the build is started. Otherwise, the build is put into the queue and is processed when a compatible build agent becomes free.

Have a "10,000-foot look" at TeamCity, and the IDE's, frameworks, version control systems and means of monitoring it supports. Point to a component on the diagram below and jump to its description:

Document generated by Confluence on Jun 16, 2008 13:43 Page 6 See also:

TeamCity 2.x documentation

Document generated by Confluence on Jun 16, 2008 13:43 Page 7 TeamCityReference

This page last changed on Nov 22, 2007 by mio.

TeamCity Reference

Document generated by Confluence on Jun 16, 2008 13:43 Page 8 _What's New in TeamCity 3.0

This page last changed on Dec 18, 2007 by yaegor. What's New in TeamCity 3.0

Please review the Upgrade Notes. TeamCity Professional and Enterprise Editions

TeamCity now comes in Professional and Enterprise editions. Professional edition is free! and allows you to access all its features except some limitations while TeamCity Enterprise is more feature-rich with unlimited number of users and projects running at a time. Per-project roles and permissions

With the introduction of two TeamCity editions, different types of user roles and access rights are now available:

• TeamCity Professional has a set of roles for all projects (guests, users, and system administrators). • The Enterprise edition enables you to assign one or several roles for users in the same project, and users will have different types of permissions. New Licensing Policy

You don't need any licenses to work with TeamCity Professional edition. The Enterprise edition provides more possibilities and requires commercial, EAP, evaluation or an open source license. Additional agents for each edition require per-agent licenses. Build Statistics Charts

Now TeamCity collects the info on the builds results over time and provides a set of visual reports, or build statistics charts, which allow to monitor your projects' health. The statistics display is customizable, and you can easily add your own graphs. Multiple Improvements Related to VCS Integration

• StarTeam support • VCS labels for the finished builds that have CVS, Subversion, Perforce, StarTeam, or ClearCase VCS roots • Sharing identical repository roots across different projects • User-based filters in VCS triggering • Per-Build Configuration VCS roots • Per-Build Configuration quiet period • Per-VCS root usernames • Per-VCS root modification check interval Improved Quality Maintenance

• .NET Duplicates finder enables you to catch similar code fragments of your # and Visual Basic .NET code in Visual Studio 2003, 2005 and 2008 solutions. • Inspections and Duplicates for Maven2 projects • Pre-tested commit from Visual Studio for Subversion Miscellaneous

• Possibility to view thread dump of the Java and .Net build processes • Hanging builds are marked in the UI, in addition to the regular notification

Document generated by Confluence on Jun 16, 2008 13:43 Page 9 • Refined interface of the Build Queue tab, which now shows expected build start and finish time, the build agent where TeamCity plans to run a build, build triggering reason and time, and the list of build agents which can run the build.

• Build tags

• Search by the build number, build tag, project/configuration name

• RSS feeds: you can configure syndication feed for the projects and events you want to be notified about. • Ability to customize build status from the build script • Ability to download build log • Ability to assign agents to specific build configurations only

Document generated by Confluence on Jun 16, 2008 13:43 Page 10 What's New in TeamCity 3.1

This page last changed on Mar 06, 2008 by yaegor. What's New in TeamCity 3.1

Additional Support

• Support for NAnt 0.86 beta 1 • More flexible use of scripts using the Build Working Directory • Windows Authentication for Unix-like computers Agent Related Improvements

• Agent filter on build history • Quick search for build on specific agent • Agent statistics Notification Enhancements

• First failure after success/success after failure notifications • Ability to watch all projects • TLS support for e-mail sending Miscellaneous

• Build scheduling with CRON expressions • Time to fix tests statistics • Parallel tests running support • Syntax highlighting in duplicates viewer • Scope filter for the duplicates and inspections browsers • Publishing artifacts before the build is finished • Ability to report tests via standard output • Improved Clean-Up Policy - Select the data to clean: artifacts, history, statistics. • Migrating to external database • Filter by test name on Tests tab

Document generated by Confluence on Jun 16, 2008 13:43 Page 11 Concepts

This page last changed on Nov 22, 2007 by mio. Concepts

This part gives a list of basic terms and their definitions, that will help you successfully work with TeamCity.

• Agent Requirements • Agent Working Directory • Authentication Scheme • Build Agent • Build Artifact • Build Checkout Directory • Build Configuration • Build Configuration State • Build Grid • Build History • Build Log • Build Numbering • Build Queue_ • Build Runner • Build State • Build Tag • Build Trigger • Build Working Directory • Change • Change State • Clean Sources • Clean-Up Policy • Code Coverage • Code Duplicates • Code Inspection • Continuous Integration • Dependent Build • Editions • Licensing Policy • Notification • Notification Conditions • Notification Rules • Notifier • Permission • Personal Build • Pinned Build • Pre-Tested (Delayed) Commit • Project • Remote Run • Responsibility • Role • RSS Feed • Run Configuration Policy • Security • Supported Platforms and Environments • TeamCity Data Directory • Testing Frameworks • User Account • VCS Root • Version Control System

Document generated by Confluence on Jun 16, 2008 13:43 Page 12 Agent Requirements

This page last changed on Apr 21, 2008 by ivrina. Agent Requirements

Agent requirements are used in TeamCity to specify whether a build configuration can run on a particular build agent.

When a build agent registers on the TeamCity server, it provides information about its configuration, including its environment variables, system properties and additional settings specified in the buildAgent.properties file.

The administrator can specify required environment variables and system properties for a build configuration on the build configuration's Agent Requirements page. For instance, if a particular build configuration must run on a build agent running Windows, the administrator specifies this by adding a requirement that the os.name system property on the build agent must contain the Windows string.

If the properties and environment variables on the build agent do not fulfill the requirements specified by the build configuration, then the build agent is incompatible with this build configuration. The Agent Requirements page lists both compatible and incompatible agents.

Sometimes the build configuration may become incompatible with a build agent if the build runner for this configuration cannot be initialized on the build agent. For instance, .NET build runners do not initialize on UNIX systems.

There are also implicit requirements. For instance, if you define a build runner parameter as a reference to another property, like %env.JDK_1_6%/lib/*.jar, this will implicitly add an agent requirement for the referenced property, i.e. env.JDK_1_6 should be defined. To define such properties you may either specify them in the buildAgent.properties file, or set the environment variable JDK_1_6 on the build agent, or specify the value on the Properties and environment variables page (in the latter case, the same value of the property for all build agents will be used).

See also:

• Concepts: Build Agent, Build Configuration • UI Reference: Agent Requirements • System Administrator Reference: Assigning Build Configurations to Specific Build Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 13 Agent Working Directory

This page last changed on Apr 21, 2008 by ivrina. Agent Working Directory

Agent working directory is the directory on an agent where all projects are built. By default, this is the /work directory.

To modify this path, navigate to buildAgent.properties file and edit the value of the workDir property (you do not need to restart agent after this).

See also:

• Concepts: Build Agent • UI Reference: Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 14 Authentication Scheme

This page last changed on Feb 06, 2008 by chamilton. Authentication Scheme

TeamCity supports the following authentication schemes:

• Default Authentication (cross-platform): A database of users is maintained by TeamCity. New users are added by the TeamCity administrator (in the administration area section) or they can register themselves if the tag is specified. • NT Authentication (Windows platforms only): This scheme requires that the TeamCity server is installed on Windows 2000, Windows XP or Windows Server 2003, however support for Unix-like computers was introduced in TeamCity 3.1. All NT domain users that can log on to the machine running the TeamCity server, can also log in to TeamCity using the same credentials. i.e. to log in to TeamCity users should provide domain and user name (DOMAIN\username) and their domain password. • LDAP Authentication (cross-platform): Authentication is performed by directly logging into LDAP with credentials entered into the login form. NT and LDAP authentication are only available in TeamCity Enterprise Edition. If the Professional Edition is configured to use NT or LDAP authentication builds will not run.

See also:

• Concepts: Authentication Settings • UI Reference: Server Configuration

Document generated by Confluence on Jun 16, 2008 13:43 Page 15 Build Agent

This page last changed on May 20, 2008 by ivrina. Build Agent

A build agent is a computer capable of running a build. Each build agent possesses a number of predefined parameters that make it compatible for creating certain builds. Build agents are joined into a build grid.

In TeamCity build agents can be authorized/unauthorized, enabled/disabled, and connected/disconnected.

Status Description Connected An agent is connected if it is registered on the TeamCity server and responds to server commands, otherwise it is disconnected. This status is determined automatically. Authorized Agents are manually authorized via the web UI. Only authorized build agents can run builds. The number of simultaneously authorized agents cannot exceed the number of agent licenses in your license pool. When an agent is unauthorized, a license is freed and a different build agent can be authorized. Purchase additional licenses to expand the number of agents that can concurrently run builds. When an agent is connected to the server for the first time is unauthorized and requires manual authorization to run the builds. If a build agent is installed and running on the same computer as TeamCity build server, it is authorized automatically. Enabled Agents are manually enabled/disabled via the web UI. The TeamCity server only distributes builds to agents that are enabled. Disabled agents can still run builds, however they must be assigned to them manually. This feature is generally used to temporarily remove agents from the build grid when they consistently have problems during the build process.

When a new agent is registered on the server for the first time, it will be unauthorized by default.

All agents connected to the server must have unique agent name.

Only users with certain roles can manage agents. See Permission for more information.

See also:

• Installation and Upgrade: Installing and Running Build Agents • Concepts: Agent Working Directory | Build Grid | Editions | Permission • Administrator reference: Assigning Build Configurations to Specific Build Agents • UI Reference: Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 16 Build Artifact

This page last changed on Jun 03, 2008 by yaegor. Build Artifact

Artifacts are files produced by a build. After finishing a build, TeamCity searches for artifacts in the build's checkout directory according to the specified artifact patters. Matching files are then uploaded to the server, where they become available for download. Artifacts stay on the server and are available for download until the artifacts for the build are cleaned up. Examples of artifacts are installers, WAR files, reports, log files, etc.

Artifacts of a build are specified on the general settings page using comma-, or newline- separated values of the format: file_name|directory_name|Ant-like wildcard [ => target_directory ]

The format contains:

• file_name — to publish the file. The file will be published by its name. • directory_name — to publish all the files and subdirectories within the directory specified. The files will be published preserving the directories structure under the directory specified (the directory itself will not be included). • wildcard — to publish files matching Ant-like pattern ("*" and "**" wildcards are only supported). The files will be published preserving the structure of the directories matched by the wildcards (directories matched by "static" text will not be created). That is, TeamCity will create directories starting from the first occurrence of the wildcard in the pattern. • target_directory — the directory in the resulting build's artifacts that will contain the files determined by the left part of the pattern.

The names are relative to the build checkout directory.

An optional part starting with => symbols and followed by the target directory name can be used to publish the files into the specified target directory. If target directory is omitted the files are published in the root of the build artifacts. You can use "." (dot) as reference to the build checkout directory.

Examples:

• install.zip — publish file named install.zip in the build artifacts • dist — publish the content of the dist directory • target/*.jar — publish all jar files in the target directory • target/**/*.txt => docs — publish all the txt files found in the target directory and its subdirectories. The files will be available in the build artifacts under the docs directory. • reports => reports, distrib/idea.zip — publish reports directory as reports and files matching idea*.zip from the distrib directory into the artifacts root. TeamCity stores artifacts on disk in a directory structure that can be accessed directly (e.g. by configuring the Operating System to share the directory over the network). The artifacts are stored under /system/artifacts folder. Storage format is described in the TeamCity Data Directory section. Build artifacts are not archived in TeamCity and stay as they are (uncompressed).

You can download artifacts of a build via the web UI from the Artifacts column of the Projects page, from the Overview tab of the Build Configuration Home Page or from the Artifacts tab of the Build Results page. Artifacts downloading can be automated as described in the section Patterns For Accessing Build Artifacts.

Build artifacts can also be uploaded to the server while the build is still running. To instruct TeamCity to upload the artifacts, build script should be modified to send service messages

Artifacts are stored on the disk on the server, under TeamCity Data Directory/artifacts/// directory. The artifacts can be copied

Document generated by Confluence on Jun 16, 2008 13:43 Page 17 directly form the directory on the server (if OS is configured to provide access for it). TeamCity computer's administrator can delete artifacts directly form the disk. In this case, build's artifacts will no longer be available.

See also:

• Concepts: Dependent Build • Administrator's Reference: Configuring Artifact Dependencies • UI Reference: Artifact Dependencies | Projects

Document generated by Confluence on Jun 16, 2008 13:43 Page 18 Build Checkout Directory

This page last changed on Apr 28, 2008 by ivrina. Build Checkout Directory

The build checkout directory is the directory where all of the project's sources reside. If the VCS checkout mode property of the build configuration is set to Automatically on server or Automatically on agent, TeamCity places the sources directly into the checkout directory.

If not specified, the following directory is used: /. The VCS settings hash code is calculated based on VCS roots and VCS settings used by the build configuration. Effectively, this means that the directory is shared between all the build configurations with the same VCS settings.

If you need to know the directory used by a build configuration, you can refer to /directory.map generated file which lists build configurations with the directory used by them.

If for some reason default directory does not match your requirements (for example, the process of creating builds depends on some particular directory), you may want to specify your own build checkout directory.

In the build script you may refer to the effective value of build checkout directory via the .build.checkoutDir property provided by TeamCity.

The checkout directory is automatically cleaned up if not used (no builds use it as checkout directory) for a specified period of time (by default it is two weeks). The time frame can be changed by specifying teamcity.agent.build.checkoutDir.expireHours agent property.

If you upgrade to TeamCity 3.x from previous versions, please refer to Upgrade Notes describing several checkout directory-related issues.

See also:

• Administrator's Guide: Configuring VCS Settings • UI Reference: Build Configuration Home Page| Administration

Document generated by Confluence on Jun 16, 2008 13:43 Page 19 Build Configuration

This page last changed on Apr 11, 2008 by ivrina. Build Configuration

Build Configuration describes a class of builds of particular type, or a procedure used to create builds. Examples of build configurations are integration builds, release builds, nightly builds, etc. A build configuration is characterized with its state. In particular, it can be paused or active. If a build configuration is paused, its build triggers are disabled until the configuration is activated.

You can explore details of a build configuration in its home page, and change its settings in the editing page.

A build configuration can be paused or activated in several places of the TeamCity UI:

• The Build Triggering section of the Administration page.

• The Actions link on the Build Configuration Home Page toolbar

• The Current status field of the Overview tab of the Build Configuration Home Page

See also:

• Concepts: Build Trigger • UI Reference: Create/Edit Build Configuration | Build Configuration Home Page

Document generated by Confluence on Jun 16, 2008 13:43 Page 20 Build Configuration State

This page last changed on Apr 22, 2008 by ivrina. Build Configuration State

In general, build configuration state reflects the state of its last finished build (except personal builds which do not affect the build configuration state). Also, the build configuration state will change to "failed" when there's at least one currently running and failing build, even if the last finished build was successful. You can view the build configuration status in the Projects tab.

Icon Build configuration state Description paused Build configuration was paused, so that no builds are triggered automatically. unknown There were no finished builds in this configuration. successful The last build executed successfully. failed The last build with this build configuration executed with errors or one of the currently running builds is failing. responsibility taken Some developer is trying to fix the problems with the failed builds (see Responsibility). probably fixed The developer who took responsibility for the failed builds has submitted a fix; in this case the status will not change to successful until the build with the fix has executed successfully.

See also:

• Concepts: Build Configuration | Build State | Change State • UI Reference: Projects | Create/Edit Build Configuration | Build Configuration Home Page | Build Triggering

Document generated by Confluence on Jun 16, 2008 13:43 Page 21 Build Grid

This page last changed on Apr 15, 2008 by ivrina. Build Grid

A build grid is a pool of computers (Build Agents) used by TeamCity to simultaneously create builds of multiple projects. The build grid employs currently-unused resources from multiple computers, any of which can run multiple builds and/or tests at a time, for single or multiple projects across your company.

See also:

• Concepts: Build Agents| Build Queue • UI Reference: Agents | Build Queue

Document generated by Confluence on Jun 16, 2008 13:43 Page 22 Build History

This page last changed on Nov 30, 2007 by chamilton. Build History

The build history is the record of past builds produced by TeamCity.

To view the build history, click the Projects tab, expand the desired project and build configuration, and click a build result link. In the Build history section of the Build Results page, click previous and next links to browse through, or click All history link to open the history page.

See also:

• UI Reference: Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 23 Build Log

This page last changed on Nov 26, 2007 by mio. Build Log

Build Log is a list of the events which took place when creating a build. Build log is available in the Build Results page, and enables viewing a complete log, or important messages only.

You can download a full build log from the Build Results page using the link

See also:

• Administrator's Reference: Logs of Internal Events • UI Reference: Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 24 Build Numbering

This page last changed on Dec 05, 2007 by mio. Build Numbering

Each build in TeamCity is assigned a build number. This number is shown in the UI and it can be referenced from various places. You can also get access to the build number in your build, using either the build.number system property or the BUILD_NUMBER environment variable. You can specify how build numbers are composed on the General Settings page for each build configuration. The primary setting for this is the "Build number format", an arbitrary string that can reference either the build counter or the VCS changeset number.

To reference the build counter, enter {0} - the build counter will increase the number with each build (this can be edited in "Build Counter" setting). To reference the VCS changeset number, enter {build.vcs.number.1} - this will be replaced with the actual changeset number from the VCS. As long as TeamCity supports several VCS for each project, there could be {build.vcs.number.2} and more, depending on number of VCSs used.

A build number format example:

1.0.{0}.{build.vcs.number.1}

See also:

• UI Reference: Create/Edit Build Configuration • Administrator's Reference: System Properties of a Build Configuration

Document generated by Confluence on Jun 16, 2008 13:43 Page 25 Build Queue_

This page last changed on Dec 03, 2007 by mio. Build Queue

The build queue is a list of build configurations that TeamCity will distribute to compatible build agents as they become available. You can move build configurations up or down in the queue on the Build Queue page.

See also:

• UI Reference: Build Queue

Document generated by Confluence on Jun 16, 2008 13:43 Page 26 Build Runner

This page last changed on Nov 23, 2007 by chamilton. Build Runner

Build runner is a mechanism that executes a build of a certain type. Build runners are configurable in the Build Runners section of the Create/Edit Build Configuration page.

See also:

• UI Reference: Build Runners

Document generated by Confluence on Jun 16, 2008 13:43 Page 27 Build State

This page last changed on Feb 18, 2008 by chamilton. Build State

The build state appears next to each build under the expanded view of the build configuration on the projects tab.

Build States

Icon State Description running successfully A build is running successfully. successful A build finished successfully in all specified build configurations. running and failing A build is failing. failed A build failed at least in one specified build configuration.

Personal Build States

Icon State Description running successfully A personal build is running successfully. successful A personal build has completed successfully for all specified build configurations. running and failing A personal build is running with errors. failed A personal build failed at least in one specified build configuration.

A build can also appear with the icon:

hanging or outdated The tooltip will display additional information about the warning.

See also:

• Concepts: Build Configuration State | Change | Change State • UI Reference: My Changes | Projects | Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 28 Build Tag

This page last changed on Mar 12, 2008 by ivrina. Build Tag

Build tags are labels that can help you to:

• organize history of your builds • quickly navigate to the builds marked with the specific tag • search for a build with a particular tag

You can assign any number of tags for a single build, for example, EAP or release.

Tag a particular build on the Overview tab of the Build Results page, or in the Overview tab of the Build Configuration Home Page. To do that, click the down-arrow button in the Tags column of the desired build number and type the desired tag name in the Edit tags dialog. The build tag appears in the Recent history of builds on this page. Clicking the tag you filter out all of the builds in the history and show only builds marked with the tag.

Additionally you can search for builds with particular tags using the search field on the Projects page.

See also:

• UI Reference: Build Configuration Home Page| Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 29 Build Trigger

This page last changed on Apr 22, 2008 by ivrina. Build Trigger

Build trigger is an event that initiates a new build. The build is put into the build queue and is run when there are agents that can run it.

In TeamCity, build can be triggered by:

• VCS trigger — the build is triggered when changes are detected in the version control system roots attached to the build configuration • Schedule trigger — the build is triggered at a specified time • Dependency trigger — after a build of another build configuration completes successfully • Manually — a user clicked Run button for a build configuration

A build can also be triggered by an HTTP GET request.

See also:

• Concepts: Build Configuration • UI Reference: Create/Edit Build Configuration | Build Triggering

Document generated by Confluence on Jun 16, 2008 13:43 Page 30 Build Working Directory

This page last changed on May 07, 2008 by yaegor. Build Working Directory

The build working directory is the directory set as current for the build process. By default, this is the same directory as the Build Checkout Directory. If the build script needs to run from a location other than the checkout directory, then you can specify it explicitly using the Working Directory field on the settings page of the build runner.

Not all of the runners provide the working directory setting.

The path entered in the Working Directory field can be either absolute or relative to the build checkout directory. When using this option, all of the other paths should still be entered relative to the checkout directory.

See also:

• Concepts: Build Checkout Directory • UI Reference: Build Runners

Document generated by Confluence on Jun 16, 2008 13:43 Page 31 Change

This page last changed on Apr 24, 2008 by ivrina. Change

Any modification of the source code which you introduce. If a change has been committed to the version control system, but not yet included in a build, it is considered pending for a certain build configuration.

TeamCity suggests several ways to view changes:

• My Changes page shows the list of builds that contain changes, committed by the current user and already included in builds. • Pending changes are accessible from the Project page, build configuration page, or build results page.

Viewing and analyzing changes involves the following possibilities:

• Observing actual changes that are already included in the build, in the Changes link of the Projects page. • Observing pending changes in the Pending Changes tab of the the Build Configuration Home Page. • Navigating to the related issues in a bug tracking system • Navigating to the source code and viewing differences • Taking responsibility for a failed build, if your changes have caused a build failure.

See also:

• Concepts: Version Control System | Build Configuration| Responsibility • UI Reference: Version Control Settings | Pending Changes | Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 32 Change State

This page last changed on Mar 12, 2008 by ivrina. Change State

Change States

Icon State Description pending The change is scheduled to be integrated into a build that is currently in the build queue. Even if a change has been successfully integrated into a build, the change will appear as pending when it is scheduled to be added to a different build. running successfully The change is being integrated into a build that is running successfully. successful The change was integrated into build that finished successfully. running and failing The change is being integrated into a build that is failing. failed The change was integrated into a build that failed.

Personal Change States

Icon State Description pending The change is scheduled to be integrated into a personal build that is currently in the build queue. running successfully The change is being integrated into a personal build that is running successfully. successful The change was integrated into a personal build that finished successfully. running and failing The change is being integrated into a personal build that is failing. failed The change was integrated into a personal build that failed.

See also:

• Concepts: Build Configuration State | Build State | Change • UI Reference: My Changes

Document generated by Confluence on Jun 16, 2008 13:43 Page 33 Clean Sources

This page last changed on Apr 24, 2008 by yaegor. Clean Sources

Cleaning sources means that the previous project sources are deleted from the build agent and new project sources are checked out, when the next build of the selected build configuration is created on the agent. Cleaning sources is recommended if problems occurred with the source code (for example, the sources may have been broken).

You can also enable automatic cleaning the project sources before a build starts, if you check the option Clean all files before build on the Create/Edit Build Configuration> General Settings page.

You can invoke clean sources action for a build configuration (the checkout directory corresponding to the build configuration will be cleaned on all the agents) from the Build Configuration page (see "Actions" drop-down in the top right corner), or for an agent (all checkout directories on the agent will be cleaned before the next build in the corresponding directory) from the Agent Details page.

Document generated by Confluence on Jun 16, 2008 13:43 Page 34 Clean-Up Policy

This page last changed on Apr 04, 2008 by yaegor. Clean-Up Policy

A policy that defines how to clean up build data (build log messages, changes, artifacts and so on). The clean-up policy contains a number of rules, which can be defined for a specific build configuration, for all configurations in a project or for all of the projects. In each rule, the administrator can define a number of successful builds to preserve, and/or a length of time that builds should be kept in history (e.g. keep builds for 7 days). These rules do not apply to pinned builds (see Pinned Build).

Also preserved with no respect to clean-up policy are the builds that are used as source for artifact dependency in other builds.

Each rule has a priority. More specific rules have a higher priority than less specific rules. For example, a rule for a build configuration will have a higher priority than a rule for a project, which is part of the build configuration. If there is more than one rule that applies to the same build configuration, the rule with higher priority will be used.

Each clean-up rule defined what data to cleanup. In TeamCity 3.1 the options are: remove only the build artifacts, remove both artifacts and the build history entry (the build will be preserved only in the statistics charts), and remove everything.

See Build History Clean-Up Policy for more details about clean-up policies configuration.

Document generated by Confluence on Jun 16, 2008 13:43 Page 35 Code Coverage

This page last changed on Apr 17, 2008 by yaegor. Code Coverage

Code coverage is a number of metrics that measure how your code is covered by unit tests. Code coverage information displays for those build configurations, where this metric is configured in the Code Coverage section of a build runner (Build Configuration Home Page | Edit Build Configuration Settings | 3.Runners). In TeamCity the code coverage is available for Ant and Ipr build runners. The engine is based on the EMMA open-source toolkit.

View the code coverage summary in the Overview tab of the Build Results page; detailed report displays in the Code Coverage tab. Chart for code coverage is also available in the Statistics tab of the build configuration.

See also:

• Concepts: Build Runner • UI Reference: Build Results page | Overview tab | Code Coverage tab Build Configuration Home Page | Statistics| Build Runners

Document generated by Confluence on Jun 16, 2008 13:43 Page 36 Code Duplicates

This page last changed on Nov 29, 2007 by chamilton. Code Duplicates

Code Duplicates are repetitive blocks of code. The Duplicates Finder build runners search for similar code fragments and provide a comprehensive report on repetitive blocks of code discovered in your code base.

See also:

• UI Reference: Java Duplicates Finder | .NET Duplicates Finder | Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 37 Code Inspection

This page last changed on Dec 05, 2007 by mio. Code Inspection

A code inspection is an automated that verifies and reports the quality of your code by looking for common problems and anti-patterns. More than 600 Java (as well as HTML, CSS, JavaScript) inspections are preformed by the Inspection Build Runner.

Inspection results are reported in the Code Inspection tab of the Build results page.

See also:

• Concepts: Build Runner • UI Reference Inspections | Code Inspection tab

Document generated by Confluence on Jun 16, 2008 13:43 Page 38 Continuous Integration

This page last changed on Dec 03, 2007 by mio. Continuous Integration

Continuous integration is a software engineering term describing a process that completely rebuilds and tests an application frequently. Generally it takes the form of a server process or daemon that:

• Monitors a file system or version control system (e.g. CVS) for changes. • Runs the build process (e.g. a make script or Ant-style build script). • Runs test scripts (e.g. JUnit or NUnit).

Continuous integration is also associated with Extreme Programming and other agile practices.

Following the principles of Continuous Integration, TeamCity allows users to monitor the software development process of the company, while improving communication and facilitating the integration of changes without breaking any established practices.

Document generated by Confluence on Jun 16, 2008 13:43 Page 39 Dependent Build

This page last changed on May 04, 2008 by ivrina. Dependent Build

In TeamCity one build configuration can depend on one or more configurations. Currently TeamCity supports two types of dependencies:

• execution dependency — completion of a build of some configuration can trigger build of another build configuration • artifacts dependency — artifacts of a build of some configuration can be made available for a build of another build configuration

See also:

• Concepts: Build Artifact • Administrator's Reference: Configuring Artifact Dependencies • UI Reference: Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 40 Editions

This page last changed on Dec 01, 2007 by chamilton. Editions

TeamCity comes in two editions, that differ in functionality and cost.

• Professional edition: the basic edition that does not require any server license key and has limitations as described in the table below. • Enterprise edition: the fully-functional edition.

The differences between editions are the following:

Professional Enterprise User limit 20 unlimited Build configuration limit 20 unlimited Bundled Build Agents 3 3 Per-project roles support Support for authentication schemes other then default

More Build Agents can be added separately. The agent licenses can be used with either TeamCity edition. For more information about purchasing agent licenses, refer to the product page. The same TeamCity distribution is used for both editions. You can switch to Enterprise edition by entering a license key on the Licenses page in the Administration area.

See also:

• Concepts: Licensing Policy | Role | Permission • Administrator's Reference: Enterprise License Expiration

Document generated by Confluence on Jun 16, 2008 13:43 Page 41 Licensing Policy

This page last changed on May 04, 2008 by ivrina. Licensing Policy

Each edition of TeamCity has its own licensing policy. TeamCity Professional does not require any license keys when using the predefined number of free agents. The Enterprise edition requires one of the following types of licenses:

• Commercial — no expiration date • Evaluation — has an expiration date and provides an unlimited amount of agents; the evaluation license can be obtained only once, a second evaluation key is not accepted after the previous one expires. • Open Source — this is a special type of license granted for open source projects, it is time-based, and provides an unlimited amount of agents.

If you need additional agents for either edition, you can purchase an additional agent license, which defines a number of additional agents you can use with TeamCity. The agent license does not expire.

Managing licenses is only available to users with the System or Project Administrator permissions: Administration > Licenses page

The TeamCity Licensing Policy does not impose any limitations on the number of instances for any of the IDE plugins or the Windows Tray Notifier. Upgrade

All TeamCity 1.x/2.x customers qualify for a free upgrade to TeamCity 3.x Enterprise edition. Please contact our sales department to receive your TeamCity Enterprise license key (make sure to provide your customer ID or any of your existing license keys).

In addition to the Enterprise edition, all TeamCity 1.x/2.x customers can enter their existing license keys in TeamCity 3.x to get a number of agents equal to the number of TeamCity 1.x/2.x user licenses. Accepted License Keys

The following license key types are accepted by TeamCity 3.x as agent keys:

• IDEA 6.0 key generated before Jan 15, 2007 — grants one agent license • TeamCity 1.x/2.x key — grants a number of agent licenses equal to the number of users licensed to use TeamCity 1.x/2.x • TeamCity 3.x enterprise key — grants enterprise version access • TeamCity 3.x agent key — grants one agent license • TeamCity 3.x evaluation key — grants temporary enterprise version access with unlimited agents; only one evaluation is allowed • TeamCity 3.x Open-Source key — grants time limited enterprise version access with unlimited agents

See also:

• Concepts: Edition | Build Agent

• Licensing: Licensing & Upgrade

Document generated by Confluence on Jun 16, 2008 13:43 Page 42 Notification

This page last changed on May 04, 2008 by ivrina. Notification

TeamCity provides wide range of notification possibilities to keep developers informed about the status of their projects. Notifications can be sent by e-mail, Jabber/XMPP instant messages and /RSS feeds or can be displayed in the IDE and the Windows system tray. Notifications will be sent according to a set of defined notification rules.

See also:

• Concepts: Notification Conditions | Notification Rules | Notifiers • Administrator's Reference: Notifier Templates Configuration • UI Reference: Notifier Settings

Document generated by Confluence on Jun 16, 2008 13:43 Page 43 Notification Conditions

This page last changed on May 23, 2008 by ivrina. Notification Conditions

Notification conditions are events you want to be notified about. The following events are supported:

Event Description The build fails A build fails. Ignore failures not caused by my changes Notification is sent only if a build failure was caused by your changes. This option is available only if the Watch builds with my changes option was selected. The first failed build after a successful build This option is supported in TeamCity 3.1 The first build's failure occurs after a successful build. Notifications about subsequent failed builds will not be sent. This option is NOT available if the Watch builds with my changes option was selected. The build is successful A build is successful. The first successful build after a failed build This option is supported in TeamCity 3.1 The build is successful after a failed build. Notifications about subsequent successful builds will not be sent. This option is NOT available if the Watch builds with my changes option was selected. The first error occurs The very first error occurs in a build. Notification is sent immediately, even before the build is finished. The build starts A build starts. The build is probably hanging TeamCity detects that a build is probably hanging. The hanging build detection heuristics includes exceeded build estimate and no build messages received for a certain amount of time. Responsibility changes Any activity of a person that is responsible for a build's failure (e.g. this person takes responsibility for the failed build, or reports that problem is fixed, etc.) Notification about the first successful build after the fixes will also be sent.

See also:

• Concepts: Notification | Notification Rules | Notifiers • Administrator's Reference: Notifier Templates Configuration • UI Reference: Notifier Settings

Document generated by Confluence on Jun 16, 2008 13:43 Page 44 Notification Rules

This page last changed on Dec 03, 2007 by mio. Notification Rules

A notification rule is defined by selecting the projects and events that happen to those projects that you want to be notified about. You can also be notified about events originating from the builds with your changes.

TeamCity comes with a default notification rule. It will send you an email notification if a build with your changes has failed. This rule starts working after you enter the email address you want your notifications sent to.

When a build generates an event, notification rules are checked in top-down order and the first that matches a build is used to determine whether to send a notification or not.

You can define notification rules for the different notifiers in the My Settings and Tools page. See Notifier Settings for details.

See also:

• Concepts: Notifiers • UI Reference: My Settings and Tools

Document generated by Confluence on Jun 16, 2008 13:43 Page 45 Notifier

This page last changed on Dec 01, 2007 by chamilton. Notifier

TeamCity supports the following notifiers:

Notifier Description Email Notifier Notifications regarding specified events are sent via email. IDE Notifier Displays the status of the build configurations you want to watch and/or the status of your changes. Jabber Notifier Notifications regarding specified events are sent via Jabber. System Tray Notifier Displays the status of the build configurations you want to watch in the Windows system tray, and displays pop-up notifications on the specified events. Atom/RSS Feed Notifier Notifications regarding specified events are sent via an Atom/RSS feed.

You can configure the notifier settings, create, change and delete notification rules in the Watched Builds and Notifications section of the My Settings and Tools page.

See also:

• Concepts: Notification Conditions | Notification Rules | RSS Feed • Administrator's Reference: Notifier Templates Configuration • UI Reference: My Settings And Tools| Notifier Settings

Document generated by Confluence on Jun 16, 2008 13:43 Page 46 Permission

This page last changed on May 04, 2008 by ivrina. Permission

A permission is an authorization granted to TeamCity users to perform particular operations. In TeamCity the administrator assigns roles to users. Each role has a set of permissions. A user can have different roles in different projects, and hence, the permissions are project-based.

Permissions in TeamCity Enterprise

In TeamCity Enterprise offers flexible uses of roles, which can be assigned users on a per-project basis.

Permissions can manually be added or removed from roles listed below by editing the roles- config.xml file in the config directory of the . When assigning roles, the view role permissions link in the Web UI will accurately display a list permissions for each role in accordance to how they have been manually re-configured. Enterprise Roles Permissions Project Viewer View project Project Developer Run/stop build, remove build from the queue, pin/unpin build, tag build, pause/activate build configuration, clean build configuration sources, take responsibility, view project, view build configuration settings, view VCS file content, manually label build, and reorder builds in the queue Agent Manager Change agent run configuration policy, and enable/ disable agent Project Administrator All of the project developer and agent manager permissions and edit project, change clean up rules, change user roles in a project, stop any personal build and remove it from the queue System Administrator All of the project administrator permissions and create/copy project, change shared VCS root, create/delete user account, modify user profile and roles, manage server licenses, change server settings, clean sources on an agent, authorize agent, configure server data cleanup, change own profile

Permissions in TeamCity Professional

In TeamCity Professional roles are fixed across all of the projects and permissions cannot be added or removed from a role. Professional Roles Permissions Guest View projects User Run/stop build and remove build from the queue, pin/unpin build, tag build, pause/activate build configuration, clean build configuration sources, take responsibility, view project, view build configuration settings, view VCS file content, manually label build, reorder builds in the queue Administrator All of the user permissions and change agent run configuration policy, enable/disable agent, edit project, change clean up rules, change user roles in a project, stop any personal build and remove it from the queue, create/copy project, change shared VCS root, create/delete user account, modify user profile and roles, manage server licenses, change server settings, clean sources on an agent, authorize

Document generated by Confluence on Jun 16, 2008 13:43 Page 47 agent, configure server data cleanup, change own profile

See also:

• Concepts: Role | User Account • UI Reference: My Settings And Tools

Document generated by Confluence on Jun 16, 2008 13:43 Page 48 Personal Build

This page last changed on May 04, 2008 by ivrina. Personal Build

A personal build is a build initiated as Remote Run or Pre-Tested Commit. Only users with "Project Developer" role can initiate a personal build.

The build uses the current VCS repository sources plus the changed files identified during pre-tested commit or remote run initiation. The results of the Personal Build can be seen in the "My Changes" view of the corresponding IDE plugin and on the My Changes page of the TeamCity web UI. Finished personal builds are listed in the builds history, but only for the users who initiated them.

The personal build feature requires tight integration with the version control system. The following combinations are currently supported:

• IntelliJ IDEA Plugin — Subversion, Perforce, CVS, Visual SourceSafe, ClearCase, StarTeam • Eclipse Plugin — Subversion • Visual Studio Plugin — Subversion, Team Foundation Server The same info is featured as a table on Remote Run page In order for Personal Build functionality to work properly using CVS, VSS and TFS version control systems, the VCS should be configured in exactly the same way on the TeamCity server and on the client computer (running the IDE). This means that the same VCS server names (disk name in the case of VSS) should be used.

See also:

• Concepts: Pre-tested Commit| Remote Run • Working with Tools: IntelliJ IDEA Plugin | Eclipse Plugin | Visual Studio Plugin

Document generated by Confluence on Jun 16, 2008 13:43 Page 49 Pinned Build

This page last changed on Dec 03, 2007 by mio. Pinned Build

A build can be "pinned" to prevent it from being removed when a clean-up procedure is executed, as stipulated by the clean-up policy.

You can pin or unpin a build in the Overview tab of the Build Configuration Home Page, or in the Overview tab of the Build Results page.

See also:

• Concepts: Clean-up policy • UI Reference: Projects | Build Configuration Home Page- Overview tab

Document generated by Confluence on Jun 16, 2008 13:43 Page 50 Pre-Tested (Delayed) Commit

This page last changed on Feb 15, 2008 by chamilton. Pre-Tested (Delayed) Commit

An approach which prevents committing defective code into a build, so the entire team's process is not affected.

Submitted code changes first go through testing. If it passes all of the tests, TeamCity can automatically submit the changes to version control. From there, it will automatically be integrated into the next build. If any test fails, the code is not committed, and the submitting developer is notified.

The TeamCity plugins for IntelliJ IDEA, Visual Studio 2005/2008 and Eclipse extend the respective IDE with the remote run and pre-tested commit features. Developers test their changes by performing a Remote Run. A pre-tested commit is enabled when commit changes if successful is selected.

For a list of Version Control Systems supported by each IDE please see supported platforms and environments.

See also:

• Concepts: Remote Run • Working with Tools: IntelliJ IDEA Plugin | Eclipse Plugin | Visual Studio Plugin

Document generated by Confluence on Jun 16, 2008 13:43 Page 51 Project

This page last changed on May 04, 2008 by ivrina. Project

Project is a simple grouping of the build configurations. The project has a name (usually corresponds to the name of a real project) and can have some meaningful description.

TeamCity uses project level for managing security. In TeamCity Enterprise Edition is it is possible to assign per-project roles to users. This makes it possible to assign users different permissions for each project. TeamCity Professional Edition lacks this feature and users are assigned permissions for all of the projects.

You can create and change projects in the Administration page. Use the Projects page to configure the visible projects that display in the overview.

See also:

• Concepts: Build Configuration • UI Reference: Administration | Projects | My Settings And Tools

Document generated by Confluence on Jun 16, 2008 13:43 Page 52 Remote Run

This page last changed on May 04, 2008 by ivrina. Remote Run

A remote run is a Personal Build initiated by a developer from one of the supported IDE plugins to test how the changes will integrate into the project's code base. Unlike Pre-tested Commit, no code is checked into the VCS regardless of the state of the personal build initiated via Remote Run.

For a list of Version Control Systems supported by each IDE please see supported platforms and environments.

See also:

• Concepts: Pre-tested Commit | Personal Build • Working with Tools: IntelliJ IDEA Plugin | Eclipse Plugin | Visual Studio Plugin

Document generated by Confluence on Jun 16, 2008 13:43 Page 53 Responsibility

This page last changed on Dec 04, 2007 by mio. Responsibility

In TeamCity if a build fails, the developer can take responsibility for breaking the build. As soon as he or she does it, this fact becomes visible to all other team members.

Take responsibility for a failed build in:

• Overview tab of the Build Configuration Home Page • Overview tab of the Build Results page

See also:

• Concepts: Build Configuration State • UI Reference: Build Configuration Home Page | Build Results

Document generated by Confluence on Jun 16, 2008 13:43 Page 54 Role

This page last changed on May 04, 2008 by ivrina. Role

Role is a set of permissions granted to a particular user. Roles are assigned per-project. A user can have a role in a specific project or in all available projects, or no role at all. Depending on your TeamCity edition, different roles are available. You can associate a user with a set of roles, using the Assign roles dialog. This section describes:

• TeamCity Enterprise User Roles • TeamCity Professional User Roles

TeamCity Enterprise User Roles

The roles and permissions are described and can be modified in the roles-config.xml file stored in /config. Role Description System Administrator TeamCity System Administrators have no restrictions in their permissions. They can create and manage users accounts, authorize build agents and set up projects and build configurations, edit the TeamCity server settings, manage TeamCity licenses, etc. Project Administrator Project Administrator is a person who can customize the general settings of a project, build configuration settings and assign roles to the project users. Project Developer Project Developer is a person who usually commits changes to a project. He can start/stop builds, reorder builds in the build queue, label the build sources, review agent details. Agent Manager Agent Manager is a person responsible for customizing and managing the Build Agents. Project Viewer A Project Viewer has only read-only access for the projects the role is assigned to. Additionally, Project Viewer role does not have permissions to view agent details.

TeamCity Professional User Roles

The user roles in the TeamCity Professional Edition are not configurable.

Role Description Administrator TeamCity Administrators have no limitations in their permissions. They have access to all the projects, create users accounts, manage server licenses and set up projects and build configurations. User Common users correspond to "Project Developer" for all projects in the Enterprise edition. Users cannot create and edit projects and build configurations. Guest Guest users do not need any registration to access TeamCity. This role suits well for a non-committer who just monitors the projects status on the Projects page. The number of users, logged in to TeamCity simultaneously as guests, is not limited. In particular, guests can view all projects and build configurations but cannot customize the view of

Document generated by Confluence on Jun 16, 2008 13:43 Page 55 the Projects page. Guest users cannot access the following features:

• Starting new builds and stopping running builds. • Monitoring the status of code integration on My Changes page. • Configuring notification rules and receiving any notifications. • Reviewing Agent details

See also:

• Concepts:User Account| Permission • UI Reference: User Accounts | Assign Roles

Document generated by Confluence on Jun 16, 2008 13:43 Page 56 RSS Feed

This page last changed on Nov 22, 2007 by mio. RSS Feed

TeamCity enables you to obtain information about the finished builds, or about the builds with the changes of particular users, via RSS feed. You can configure RSS feed from the TeamCity Tools sidebar of My Settings and Tools page, or from the home page of a build configuration. TeamCity produces a URL to the syndication feed on the base of the values, which you specify in the Feed URL Generator page.

See also:

• Concepts: Notifiers • UI Reference: Feed URL Generator • Working with Tools: Syndication Feed

Document generated by Confluence on Jun 16, 2008 13:43 Page 57 Run Configuration Policy

This page last changed on Nov 23, 2007 by mio. Run Configuration Policy

The run configuration policy allows you to select the specific build configurations you want a build agent to run. By default, build agents run all compatible build configurations and this isn't always desirable. The run configuration policy settings are located on the Compatible configurations tab of the Agent Details page.

See also:

• System Administrator Reference: Assigning Build Configurations to Specific Build Agents • UI Reference: Agent Details

Document generated by Confluence on Jun 16, 2008 13:43 Page 58 Security

This page last changed on May 04, 2008 by ivrina. Security

Security in TeamCity is handled by assigning different roles to users. Each role provides a set of permissions and is assigned (or not assigned) for each project, thus controlling access to the projects and the various features in the Web UI.

See also:

• Concepts: Permission | Role

Document generated by Confluence on Jun 16, 2008 13:43 Page 59 Supported Platforms and Environments

This page last changed on May 27, 2008 by yaegor. Supported Platforms and Environments

In this section:

• Platforms (Operating Systems) ° TeamCity Server ° Agents ° Windows Tray Notifier • Web Browsers • Build Runners ° For Java ° For .NET • Testing Frameworks • Version Control Systems • IDE Integration (plugin required) ° Eclipse ° IntelliJ IDEA °

Platforms (Operating Systems)

The TeamCity Server

The TeamCity server is platform independent.

Requirements:

• Java (JRE) 1.5+ (already included in Windows .exe distribution) • J2EE Servlet (2.4+) container, JSP 2.0+ container. TeamCity is tested under Tomcat 6 which is a recommended server. Tomcat 6 is already included in Windows .exe and .tar.gz distributions. TeamCity is reported to work with Jetty and Tomcat 5. Please note that Tomcat version 5.5.20 is not compatible with TeamCity because this version of Tomcat contains a number of bugs.

TeamCity server is tested under the following operating systems:

• MacOS X • Windows XP under Tomcat 6 web application server.

Reportedly works on:

• Solaris 10

Code Fragments Syntax Highlighting

The syntax highlighting (in the web difference view and Duplicates results) is available only under:

• Windows 32 bit platforms (workaround is available for Windows 64) • Linux 32 bit platforms Under other platforms the views will function normally, but the syntax highlighting will not be available.

Build Agents

Requirements:

Document generated by Confluence on Jun 16, 2008 13:43 Page 60 • Java (JRE) 1.5+ (already included in Windows .exe distribution; JDK (JRE is not enough) is necessary for IPR, Java Inspections and Duplicate Finder runners)

TeamCity agent is tested under the following operating systems:

• Linux • MacOS X • Windows 2000/XP/XP x64

Stop build functionality

Build stopping is supported on:

• Windows 2000/XP/XP x64 • Linux on x86, x64, PPC and PPC64 processors • Mac OS X on Intel and PPC processors • Solaris 10 on x86, x64 processors

The Windows Tray Notifier

• Windows 2000/XP Web Browsers

The TeamCity Web Interface is W3C complaint code, so just about any browser should work well with TeamCity. The following browsers have been specifically tested and reported to work correctly:

• Microsoft Internet Explorer 6 and 7 • Mozilla Firefox 2 and 3 beta 5 • Opera 9 • 3 under Mac Build Runners

TeamCity provides a very wide of build tools support enabling both Java and .NET software teams building their projects.

Supported Java build runners:

• Ant 1.6-1.7 (TeamCity comes bundled with Ant 1.7.0) • Maven2 2.0.x (TeamCity comes bundled with Maven 2.0.8) • IntelliJ IDEA 5, 6 and 7 projects

Supported .NET platform build runners:

• MSBuild • NAnt (versions 0.85 - 0.86) • Microsoft Visual Studio Solutions (2003, 2005, and 2008) • Duplicates Finder for Visual Studio 2003, 2005 and 2008 projects (C# up to version 2.0 and Visual Basic .NET up to version 8.0) • Command Line Runner for running any build process by a command line

Rake runner is also supported by a plugin Testing Frameworks

• JUnit 3.8.1+, 4.x • NUnit • TestNG 5.3+

Document generated by Confluence on Jun 16, 2008 13:43 Page 61 Version Control Systems

Checkout on server

• Borland StarTeam 6 and up (StarTeam client application should be installed to use StarTeam integration) • CVS (client is bundled) • IBM Rational ClearCase, Base and UCM modes (ClearCase client should be installed to use ClearCase integration) • Microsoft Visual SourceSafe 6 and 2005 (SourceSafe client should be installed to use VSS integration) • Perforce (Perforce client should be installed to use Perforce integration) • Subversion (client is bundled) • Team Foundation Server 2005 and 2008 (TFS client should be installed to use TFS integration)

Checkout on agent

• CVS • Subversion

Creating a Label

• Borland StarTeam • CVS • Perforce • Subversion

IDE integration

TeamCity provides productivity plugins for the following IDEs:

• Eclipse 3.2, 3.3 • IntelliJ IDEA 6.0 (some functionality is limited) and 7.0 • Microsoft Visual Studio 2003, 2005, and 2008

Remote run and Pre-tested commit functionality is available for the following IDEs and version control systems:

IDE Supported VCS Eclipse • Subversion IntelliJ IDEA 6.0 and 7.0 • ClearCase • CVS • Perforce • StarTeam • Subversion • Visual SourceSafe MS Visual Studio 2003, 2005, 2008 • Subversion • Team Foundation Server External Databases

• HSQLDB • MySQL 5.0.30+ (Please note that due to bugs in MySQL at least versions 5.0.20 and 5.0.22 are not compatible with TeamCity) • PostgreSQL 8+ • Oracle 10g+

Document generated by Confluence on Jun 16, 2008 13:43 Page 62 TeamCity Data Directory

This page last changed on May 12, 2008 by pavel.sher. TeamCity Data Directory

This is the directory used by TeamCity to store configuration and system files. The config subdirectory contains the configuration of your TeamCity projects, and the system subdirectory contains build logs, artifacts, and database files (if HSQLDB is being used by default). See more on the directory structure in below.

Note that the system directory stores all the artifacts of the builds in the history and can be quite large (see Clean-Up Policy to configure how many builds are kept).

By default, the is placed in the user's home directory (e.g. it is $HOME/.BuildServer under Linux and C:\Documents and Settings\\.BuildServer) under Windows. Alternatively, you can define this directory in one of the following ways:

• as a Tomcat system property teamcity.data.path (see System Properties for Running the Server) • in the TEAMCITY_DATA_PATH environment variable (this will be used if the teamcity.data.path JVM system property is not found)

The TeamCity Windows installer can configure the TeamCity data directory during one of the installation steps.

If you run TeamCity as Windows service installed via standard procedure from the Windows executable file, you will need to modify the teamcity.data.path Tomcat JVM property as described in System Properties for Running the Server. Modifying the TEAMCITY_DATA_PATH environment variable will not work in this case.

The data directory used by the running TeamCity server can be looked up on the Administration > Server Configuration page.

Structure of TeamCity Data Directory

• .BuildServer/config — a directory where projects, build configurations and general server settings are stored. ° — configuration settings specific to a particular project - project-config.xml — main project configuration, contains configurations of a project's Build Configurations - project-config.xml.N — backup copies of project-config.xml created when a project's configuration is changed via web UI ° _trash — backup copies of deleted projects ° main-config.xml — server-wide configuration settings ° database.properties — database connection settings ° vcs-roots.xml — VCS roots configurations file (both shared and not shared) ° roles-config.xml — roles-permissions assignment file ° email-config.xml — the e-mail notification template ° jabber-config.xml — the Jabber notification template ° win32-config.xml — the Windows Tray Notifier notification template ° ide-notificator-config.xml — the IDE notification template

• .BuildServer/system — a directory where build results data are stored, namely: ° license.keys — a file which stores the license keys entered into TeamCity. ° responsibles.xml — a file which stores the "Take Responsibility" data. ° artifacts — a directory where the builds' artifacts are stored. The format of artifact storage is // ° messages — a directory where build logs are stored in internal format. ° changes — a directory where the remote run changes are stored in internal format. ° buildserver.* — a set of files pertaining to the embedded HSQLDB.

Document generated by Confluence on Jun 16, 2008 13:43 Page 63 ° version.dat — a file which contains the internal version of the configuration files and database. For backup purposes, ensure it is saved/restored in sync with other data files and the database data. ° sourcesCache — (Only in TeamCity 3.0.x) a directory with internal sources caches. Can be deleted any time to clear caches, they will be restored as needed. ° clearCaseCache — (Only in TeamCity 3.0.x) a directory with internal ClearCase sources caches. Can be deleted any time to clear caches, they will be restored as needed. ° caches — (Only in TeamCity 3.1) a directory with internal caches (of the VCS repository contents). It can be manually deleted to clear caches, they will be restored automatically as needed. Direct configuration files modifications

The files in the config directory can be edited manually. They can even be edited without stopping the server. TeamCity monitors these files for changes and rereads them automatically when modifications are detected. Bear in mind that it is easy to break the physical or logical structure of these files, so edit them with extreme caution. Always back up your data before making any changes.

Please note that there are interlinking entries that link by id. Examples of such entries are build configuration -> VCS roots links and VCS root -> project links. All the entries of the same type must have unique ids. New entries can be added only if their ids are unique. Please note that it is not a good idea to place TeamCity data directory to a network folder. Such folders may disappear if network failure occurs and TeamCity may decide that projects deleted and unload them. If you really need to place data directory to such folder, we strongly recommend to disable files modifications monitoring by launching TeamCity with special system property (available since 3.1.1): teamcity.configuration.checkInterval. Set this property to -1 to disable changes checking, positive value defines changes checking interval in seconds.

Document generated by Confluence on Jun 16, 2008 13:43 Page 64 Testing Frameworks

This page last changed on May 20, 2008 by ivrina. Testing Frameworks

TeamCity supports the following testing frameworks:

• JUnit and TestNG for the following runners: ° Ant ° Maven2 (when tests are run by Surefire Maven plugin) ° IntelliJ IDEA project (only JUnit tests are supported) • NUnit for the following runners: ° NAnt (nunit2 task) ° MSBuild (NUnit community or NUnitTeamCity tasks) ° Microsoft Visual Studio Solution runners (2003, 2005 and 2008)

TeamCity recognizes when a build performs tests, and reports the test results on-the-fly, without waiting for the build completion for all the above runners except Maven2. A failing test immediately manifests itself in the build state icon, and in the Tests tab of the Build results page, though the build goes on and performs the other tests (unless configured otherwise).

See also:

• Concepts: Build State | Build Runner • Administrator reference: .NET Testing Frameworks Support | Additional Functionality in MSBuild Scripts | NAnt • UI Reference: Tests tab

Document generated by Confluence on Jun 16, 2008 13:43 Page 65 User Account

This page last changed on Nov 26, 2007 by yaegor. Account

An account is a combination of a username and password that allows TeamCity users to log on to it and use its features.

The user accounts are assigned roles (a set of permissions) by the system administrator. The types of roles available depend on which TeamCity Edition (Professional or Enterprise) you have installed.

See also:

• Concept: Role | Permission • UI Reference: Server Configuration | User Accounts | Edit General Settings of the User

Document generated by Confluence on Jun 16, 2008 13:43 Page 66 VCS Root

This page last changed on Dec 27, 2007 by chamilton. VCS Root

VCS roots are a collection of VSC settings (paths to sources, login, password, and other settings) used by TeamCity to obtain the source files for your builds. The VCS roots are monitored by TeamCity, so that any changes uploaded to the version control system are shown in TeamCity's user interface. In many cases, you'll want to set up your build configuration to trigger a new build when TeamCity detects a user has made a change to any of the build configuration's VCS roots.

By default, VCS roots can be used by all of the project's build configurations. VCS roots can also be "shared", which means they also can be used by different projects in TeamCity.

For the VCS roots under ClearCase, CVS, Perforce, StarTeam and Subversion, TeamCity can label the source files of the builds. If VCS labeling is enabled, and the labeling format is defined on the Version Control Settings page, the labels appear in the build results page.

See also:

• Concepts: Version Control System • UI Reference: Version Control Settings | VCS Roots • Administrator's Reference: Configuring VCS Settings

Document generated by Confluence on Jun 16, 2008 13:43 Page 67 Version Control System

This page last changed on Feb 20, 2008 by chamilton. Version Control System

A Version Control System (VCS) is a system for tracking the revisions of the project source files. It is also known as SCM (source code management) or a revision control system.

TeamCity supports the following VCS:

• ClearCase • CVS • Perforce • StarTeam • Subversion • Team Foundation Server • Visual Source Safe

See also:

• UI Reference: Version Control Settings • Administrator's Reference: Configuring VCS Settings

Document generated by Confluence on Jun 16, 2008 13:43 Page 68 Developing TeamCity Plugins

This page last changed on May 04, 2008 by ivrina. Developing TeamCity Plugins

This is preliminary documentation and subject to change.

TeamCity is a highly extendable system. You can add various plugins in different places, including, but not limited to:

• Custom notifiers • Custom build triggers • Custom build runners with possibility to view customized reports on the Web • Extensions to Ant Runner which allows to add custom logging and view reports on the Web • Custom statistics reports based on the information in the database • Custom user authentication • Support of additional VCS

Currently, TeamCity can be extended on the build agent side, and on the server side (including web UI). Some extensions may require to extend TeamCity in all these places. We plan to provide a description for some typical plugins and how to write them.

The sources of the TeamCity OpenAPI are placed into the root directory of full TeamCity distribution (.tar.gz or .exe distribution) under the name openApi-source.jar.

TeamCity is compiled using JDK 1.5, so plugins should use JDK 1.5 as well.

Document generated by Confluence on Jun 16, 2008 13:43 Page 69 Agent Side Extensions

This page last changed on Apr 09, 2008 by ivrina. Agent-Side Extensions

Currently, there are two ways to extend build agent:

1. Write a custom build runner 2. Write an extension to AntRunner (for instance, to process custom tasks)

Both approaches use similar way of plugin packaging and deployment (see below). Descriptor

Plugin descriptor for the build agent plugins is named build-agent-plugin.xml. A build agent reads its plugins using NanoContainer:

Package your build agent plugin as a zip archive with the following content:

/lib/ /lib/pluginJar1.jar /lib/pluginJar2.jar /otherDir/ /otherDir/someFile.txt

This archive will be unpackaged in the plugins subdirectory during the build agent installation: buildAgent/ buildAgent/bin/ buildAgent/lib/ buildAgent/plugins// buildAgent/plugins//lib/ buildAgent/plugins//otherDir/

Writing Ant Extension

Implement jetbrains.buildServer.agent.ant.AntTaskExtension interface and register it as a component in build-agent-plugin.xml file. Deployment

To deploy a build agent plugin:

1. Copy a build agent plugin's zip archive to the /update/plugins directory on the Team Server. 2. Copy server part of the plugin into the WEB-INF/lib directory of the Tomcat server. If server part was modified, restart Tomcat server. Agents will download updated plugin automatically.

Document generated by Confluence on Jun 16, 2008 13:43 Page 70 Plugin API FAQ

This page last changed on May 15, 2008 by lisar. Plugin API FAQ

What are basic entry points for TeamCity API?

See initial notes on Server Side Extensions and Typical Plugins pages.

How to create hooks for build start/fail/success and other events?

Implement BuildServerListener (or, better, extend BuildServerAdapter).

How to label sources?

For a finished build, you can label sources using the SFinishedBuild:setLabel call. A list of VCS Roots can be created using the results of SBuild:getVcsRootEntries call.

Document generated by Confluence on Jun 16, 2008 13:43 Page 71 Server Side Extensions

This page last changed on Apr 21, 2008 by yaegor. Server-Side Extensions

Server-side plugin organization and deployment

To write a server-side plugin, you'll need to include jar libraries from /WEB- INF/lib directory to your classpath. Default TeamCity web application is "/webapps/ ROOT.

Server-side plugins are delivered as a set of jar files, one of which contains the plugin descriptor file. Such plugins can process data which is logged from build agents in some specific way, provide additional web content, create custom notifiers, etc.

The plugin code should be active - plugin components should register themselves in various TeamCity managers and components. Corresponding TeamCity managers should be passed via constructor (they will be passed by Spring framework via autowiring, see Descriptor section below)

If you are extending the Web UI, please also refer to Web UI Extensions.

Descriptor

The plugin descriptor file is named build-server-plugin-.xml and contains component definitions according to Spring configuration file syntax.

Base configuration of the server can be found in /WEB-INF/lib/server.jar!/META-INF/ buildServerSpring.xml and /WEB-INF/buildServerSpringWeb.xml files.

Example descriptor:

Deployment

Put the jar files with server side plugins into the /WEB-INF/lib/ directory on the server. Writing Server-side Extensions

Build server listeners

Should extend jetbrains.buildServer.serverSide.BuildServerListener interface and register itself using SBuildServer.addListener() method. There is also a convenient jetbrains.buildServer.serverSide.BuildServerAdapter class to write such listeners. public class MyListener extends BuildServerAdapter { public MyListener(SBuildServer server) { server.addListener(this); }

Document generated by Confluence on Jun 16, 2008 13:43 Page 72 // Your overridden methods go here }

Server-side extension points

TeamCity server has a number of extension points, where a plugin can provide some additional functionality. An extension point is defined in terms of interface, which extends jetbrains.buildServer.serverSide.ServerExtension. There are several such interfaces/extension points. To register an extension, a plugin should invoke method jetbrains.buildServer.serverSide.ServerExtensionHolder#registerExtension(extension_class, pluginCode, extensionObject).

Here is a list of some extension points:

• jetbrains.buildServer.serverSide.ParametersPreprocessor allows to modify build and run parameters which are sent to TeamCity server before build start • jetbrains.buildServer.serverSide.DataCleaner allows to register additional clean-up hooks for the case when build is removed • jetbrains.buildServer.serverSide.GeneralDataCleaner allows to register global additional cleanup procedures which are called once per cleanup • jetbrains.buildServer.serverSide.MainConfigProcessor allows to read/write global TeamCity data, which are saved in XML file main-config.xml • jetbrains.buildServer.serverSide.TextStatusBuilder allows to modify build status description line, like Tests passed: 343, Fitnesse: 23

Some core components jetbrains.buildServer.serverSide.SBuildServer

This is one of the core components of the TeamCity server-side support. It manages many aspects of TeamCity, for instance:

• Access to TeamCity installation information, system and configuration directories • Global TeamCity listener, which is notified about most events in TeamCity BuildServerAdapter • Global build history access via appropriate findNNN methods • Access to various TeamCity managers (but it is much better to use dependency injection provided by Spring to achive this, because these getXXXManager methods may disappear in the future) • Extension of TeamCity via various extension points, see ServerExtensionHolder (please also use DI) • TeamCity server version, build number • Executor service for short-time processes. jetbrains.buildServer.serverSide.ProjectManager

This component provides access to TeamCity project structure, allows to list all available projects and build configurations, as well as modify their settings. See also jetbrains.buildServer.serverSide.SProject and jetbrains.buildServer.serverSide.SBuildType jetbrains.buildServer.serverSide.RunningBuildsManager

Manager for currently running builds. See also jetbrains.buildServer.serverSide.SRunningBuild jetbrains.buildServer.serverSide.BuildHistory

Provides access to build history (you can also access historical builds for a build configuration using methods in jetbrains.buildServer.serverSide.SBuildType) jetbrains.buildServer.users.UserModel

Manager of various user-oriented operations in TeamCity, allows to list/find user accounts, create user accounts etc.

Document generated by Confluence on Jun 16, 2008 13:43 Page 73 jetbrains.buildServer.vcs.VcsManager

A basic starting point for various VCS-related operations, including, but not limited to:

• VcsSupport management (add your VCS support here!) • Obtain file contents • Create/Edit VCS root, check its status • Find committers between particular builds

Document generated by Confluence on Jun 16, 2008 13:43 Page 74 Statistics customization

This page last changed on May 04, 2008 by ivrina. Statistics customization

TeamCity provides number of ways to customize statistics. You can add your own custom metrics to integrate your tools/processes, insert any stats graph/report into any extension place, etc. Quick start

• TODO: how to use a plugin sample project, how to package and deploy a plugin (links?)

• Easy way to just insert jsp fragment into WebPlace — use a helper bean

• How to insert statistics chart into jsp page

<%@taglib prefix="stats" tagdir="/WEB-INF/tags/graph"%>

• Easy way to add a custom build metric: Extend BuildValueTypeBase to just define your build metric calculation method, appearance and key - now you can reference this metric by its key in statistics chart/report tags More details

BuildType Statistics tab extension point

//WebControllerManager webControllerManager webControllerManager.addPageExtension(WebPlace.BUILD_INFO_FRAGMENT, this); customizing appearance

• width, height - graph image size • hideFilters - suppress filter controls

Details on how to add custom metrics

• Implement jetbrains.buildServer.serverSide.statistics.ValueType • Register it via jetbrains.buildServer.serverSide.statistics.StatsManager

Details on custom Build metrics

• Implement jetbrains.buildServer.serverSide.statistics.build.BuildFinishAware in your ValueType to be notified of build finished event • calculate your metric • Employ jetbrains.buildServer.serverSide.statistics.build.BuildDataStorage to publish your value • Employ jetbrains.buildServer.serverSide.statistics.build.BuildDataStorage to retrieve your dataset

Document generated by Confluence on Jun 16, 2008 13:43 Page 75 Typical Plugins

This page last changed on May 20, 2008 by lisar. Typical Plugins

In this section:

• Custom build number • Custom VCS • Custom Notifiers • Build Result Tabs • Custom User Authentication • Writing Custom Build Runner ° Agent-side Part ° Server-side Part

Custom build number public class MyBuildNumber extends BuildServerAdapter {

public MyBuildNumber(SBuildServer aBuildServer) { aBuildServer.addListener(this); }

public void buildStarted(SRunningBuild build) {

// Build Numbers set to "my" in build number pattern will be replaced with custom build number if ("my".equals(build.getBuildNumber())) { build.setBuildNumber(createBuildNumber(build)); } }

public String createBuildNumber(SRunningBuild build) { return "my custom#"; } }

Custom VCS

See jetbrains.buildServer.vcs.VcsManager.

If custom VCS plugin requires some settings to be edited from the web UI, then it should also provide a JSP file for its settings. This JSP file should be placed into the plugin jar under the buildServerResources/ path. In the buildServerSpring.xml you should also configure webResourcesUnpacker (note that you should use your vcs name as a plugin name), see above.

In the JSP file you should use special custom tags for input fields, radio buttons and checkboxes that correspond to your VCS properties. These custom tags are located in the props tag library:

<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>

You can use JSP files of existing VCS plugins as an example.

Document generated by Confluence on Jun 16, 2008 13:43 Page 76 Custom Notifiers

Custom template processing: http://www.intellij.net/forums/thread.jspa?messageID=5187731

Build Result Tabs

Create subclass of ViewLogTab and attach it to the web place: WebControllerManager.addPageExtension(WebPlace.VIEW_LOG_TAB, this)

Custom User Authentication

Custom authentication API is based on Sun JAAS API. To provide your own authentication scheme, you should provide a login module class which must implement interface javax.security.auth.spi.LoginModule and register it in the jetbrains.buildServer.serverSide.auth.LoginConfiguration.

For example: public class CustomLoginModule implements javax.security.auth.spi.LoginModule { private Subject mySubject; private CallbackHandler myCallbackHandler; private Callback[] myCallbacks; private NameCallback myNameCallback; private PasswordCallback myPasswordCallback;

public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { // We should remember callback handler and create our own callbacks. // TeamCity authorization scheme supports two callbacks only: NameCallback and PasswordCallback. // From these callbacks you will receive username and password entered on the login page. myCallbackHandler = callbackHandler; myNameCallback = new NameCallback("login:"); myPasswordCallback = new PasswordCallback("password:", false); // remember references to newly created callbacks myCallbacks = new Callback[] {myNameCallback, myPasswordCallback};

// Subject is a place where authorized entity credentials are stored. // When user is successfully authorized, the jetbrains.buildServer.serverSide.auth.ServerPrincipal // instance should be added to the subject. Based on this information the principal server will know a real name of // the authorized entity and realm where this entity was authorized. mySubject = subject; }

public boolean login() throws LoginException { // invoke callback handler so that username and password were added // to the name and password callbacks try { myCallbackHandler.handle(myCallbacks); } catch (Throwable t) { throw new LoginException(t.toString()); }

// retrieve login and password final String login = myNameCallback.getName(); final String password = new String(myPasswordCallback.getPassword());

// perform authentication

Document generated by Confluence on Jun 16, 2008 13:43 Page 77 if (checkPassword(login, password)) { // create ServerPrincipal and put it in the subject mySubject.getPrincipals().add(new ServerPrincipal(null, login)); return true; }

return false; }

private boolean checkPassword(final String login, final String password) { return true; }

public boolean commit() throws LoginException { // simply return true return true; }

public boolean abort() throws LoginException { return true; }

public boolean logout() throws LoginException { return true; } }

Now we should register this module in the server. To do so, we create a login module descriptor: public class CustomLoginModuleDescriptor implements jetbrains.buildServer.serverSide.auth.LoginModuleDescriptor { // Spring framework will provide reference to LoginConfiguration when // the CustomLoginModuleDescriptor is instantiated public CustomLoginModuleDescriptor(LoginConfiguration loginConfiguration) { // register this descriptor in the login configuration loginConfiguration.registerLoginModule(this); }

public Class getLoginModuleClass() { // return our custom login module class return CustomLoginModule.class; }

public Map getOptions() { // return options which can be passed to our custom login module // for example, we could store reference to SBuildServer instance here return null; }

public String getTextForLoginPage() { // return text to show on the login page which could describe // what should be entered in the user name and password fields return null; }

public String getDisplayName() { // presentable name of this plugin return "My custom authentication plugin"; } }

Finally we should create build-server-plugin-ourUserAuth.xml as it is described above and write there CustomLoginModuleDescriptor bean:

Document generated by Confluence on Jun 16, 2008 13:43 Page 78

Create a jar, put it into the WEB-INF/lib directory of the TeamCity server and restart it. When the server is started, you should be able to choose your custom plugin from the drop down list of the Administration -> Server Configuration page.

Writing a Custom Build Runner

Agent-side Part

Implement jetbrains.buildServer.agent.BuildRunner interface (you may also extend GenericProgramRunner or even JavaProgramRunner helpers for this). To log your messages, you may obtain instance of ServerLogger singleton (you may also use ServerLoggerFacade for convinience).

TBD

Server-side Part

Build agent plugin should also provide server side jar with a class implementing jetbrains.buildServer.serverSide.RunType interface. The implementation of the RunType interface must be registered in the jetbrains.buildServer.serverSide.RunTypeRegistry. You can do this in the constructor of the RunType implementation, like this: public class CustomRunTypeImpl { ... public CustomRunType(RunTypeRegistry runTypeRegistry) { runTypeRegistry.registerRunType(this); } ... }

Please note that you should also provide the plugin descriptor file named build-server-plugin- .xml which will contain reference to the RunType implementation:

Document generated by Confluence on Jun 16, 2008 13:43 Page 79 Web UI Extensions

This page last changed on Apr 11, 2008 by ivrina. Web UI Extensions

Web resources (jsp, , js, etc) should be placed into the plugin jar file under the path buildServerResources/. After that you should register this jar in the WebResourcesManager. This should be done while Spring is creating objects (i.e. in the plugin constructor). For example: public class MyPlugin { public MyPlugin(WebResourcesManager resourcesManager) { resourcesManager.addPluginResources("myPlugin", "myPlugin.jar"); } }

Plugin jar should be placed into the /WEB-INF/lib/ directory. Resources like buildServerResources/ file.js will be unpacked under the name /plugins/aPluginName/file.js. You can obtain this path with help of WebResourcesManager.resourcePath() method.

Document generated by Confluence on Jun 16, 2008 13:43 Page 80 Installation and Upgrade

This page last changed on Nov 07, 2007 by mio. Installation and Upgrade

In this part you will learn how to install and upgrade TeamCity.

• Installation • Migrating to an External Database • Setting up an External Database • TeamCity Data Backup • Upgrade • Upgrade Notes

Document generated by Confluence on Jun 16, 2008 13:43 Page 81 Installation

This page last changed on Feb 12, 2008 by chamilton.

Installation

Obtaining TeamCity

TeamCity installation package is identical for both Professional and Enterprise Editions and is available at http://www.jetbrains.com/teamcity/download/index.html

Download one of the three available installation packages:

Target Download Note Windows TeamCity.exe Executable Windows installer bundled with Tomcat and Java 1.5 JRE Linux, MacOS X TeamCity.tar.gz Package bundled with Tomcat servlet container for Linux, MacOS X or manual installation J2EE container TeamCity.war Package for installation into an existing J2EE container

Installing the TeamCity Server

Follow the environment specific instructions on Installing and Configuring the TeamCity Server.

Larger development teams, which run frequent builds are recommended to reduce the load on the TeamCity server by disabling the default build agent service on the server. These teams will need to install additional build agents (see below).

Installing Additional Build Agents

Follow the instructions on Setting up and Running Additional Build Agents.

See also

• Installation: Installing and Configuring the TeamCity Server | Setting up and Running Additional Build Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 82 Installing Additional Plugins

This page last changed on Apr 21, 2008 by yaegor. Installing Additional Plugins

For a list of available plugins, see plugins list

Installing jar-packaged server-side plugin

1. Shutdown TeamCity server 2. Copy the plugin jar file into /WEB-INF/lib directory. Default TeamCity web application is /webapps/ROOT. 3. If the plugin requires any libraries, copy them into /WEB-INF/lib directory also. 4. Start TeamCity server.

Installing agent-side plugin

• Copy the agent plugin into /WEB-INF/update directory.

All the agents will be upgraded automatically. No agent or server restart is necessary.

Document generated by Confluence on Jun 16, 2008 13:43 Page 83 Installing and Configuring the TeamCity Server

This page last changed on May 08, 2008 by yaegor. Installing and Configuring the TeamCity server

In this section:

• Installing the TeamCity Server • Configuring the TeamCity Server Installing the TeamCity Server

Having obtained the TeamCity installation package, proceed with installing the build server for:

• Windows .exe distribution • .tar.gz distribution • .war distribution

The build server and one build agent will be installed by default for Windows, Linux or MacOS X. If you need more build agents, refer to the section Installing Additional Build Agents. By default, TeamCity uses an HSQLDB database that does not require special configuring. This database works fine for testing and evaluating the system. For production purposes using a standalone external database is recommended.

• Setting up an External Database • Migrating to an External Database

Installing TeamCity via executable file (Windows only)

For the Windows platform, run the executable file and follow the installation instructions. You have options to install the TeamCity web server and one build agent that can be run as a Windows service.

If you opted to install the services, use standard Windows Services applet to manage the service. The server can also be started/stopped with the help of provided scripts#runStopServer.

If you want to edit the TeamCity server's service parameters, memory settings or system properties after the installation, run the command '/bin/tomcat6w.exe //ES//TeamCity' and modify Java Options under the Java tab. more information Service account

Please make sure the service account has:

• write rights for the TeamCity Data Directory, • all the necessary permissions to work with the source controls used. This includes: ° access to Microsoft Visual SourceSafe database (if Visual Source Safe integration is used). ° the user, under which TeamCity server service runs, and ClearCase view owner are the same (if ClearCase integration is used).

By default, Windows service in installed under SYSTEM ACCOUNT. To change it, use the Services applet (Control Panel | Administrative Tools | Services)

Installing TeamCity bundled with Tomcat servlet container (Linux, Mac OS X, Windows)

Unpack TeamCity.tar.gz archive (for example, using tar xfz TeamCity.tar.gz command under Linux, or WinZip, WinRar or alike utility under Windows).

Document generated by Confluence on Jun 16, 2008 13:43 Page 84 Please use GNU tar to unpack. (e.g. Solaris 10 tar is reported to truncate too long file names and may cause a ClassNotFoundException. Consider getting GNU tar at Solaris packages or using gtar xfz command)

TeamCity server can be started and stopped by the scripts provided in the /bin directory To start/stop TeamCity server and default agent at the same time use runAll script. To start/stop only the TeamCity server use teamcity-server script (available since TeamCity 3.1). e.g. use runAll.bat start to start the server and the default agent, and use runAll.bat stop to stop the server and the default agent

By default, TeamCity runs on http://localhost:8111/ and has one registered build agent that runs on the same computer.

The port number can be edited in the /conf/server.xml file, line

Headless mode for TeamCity If you are running TeamCity on a server that is not running a windowing system, e.g. Linux, then you may encounter this error when hitting the Statistics page:

javax.el.ELException: Error reading 'graphInfo' on type jetbrains.buildServer.serverSide.statistics.graph.BuildGraphBean

You can resolve this problem by adding this to your catalina.sh file:

JAVA_OPTS="-Djava.awt.headless=true"

Alternatively, you can add it to a new setenv.sh file that sits in your bin directory. The same can be applied to any start up script if you are using an third party container.

Installing TeamCity into existing J2EE container

1. Copy the downloaded TeamCity.war file into the web applications directory of your J2EE container under teamCity.war name. 2. To configure TeamCity logging system, modify J2EE container settings to pass the following JVM options to the TeamCity web application:

-Dlog4j.configuration=file:../conf/teamcity-server-log4j.xml -Dteamcity_logs=../logs/

Up to date values and conf/teamcity-server-log4j.xml file can be looked up in the bin/teamcity- server script available in .exe and tar.gz distributions. Sample teamcity-server-log4j.xml file.

1. Ensure TeamCity web application can use at least 512Mb heap size and 96Mb of PermGen size (usually, this is done by specifying JVM options -Xmx512m -XX:MaxPermSize=128m). Please increase the sizes if you have other web applications running in the same JVM. 2. Restart the server or deploy the application via servlet container administration interface and access http://server/teamCity/.

TeamCity J2EE container distribution is tested to work with Tomcat 6.x servlet container. (Tomcat version 5.5.20 is not compatible with TeamCity because this version of Tomcat contains a number of errors) Configuring the TeamCity Server

Tips

• If you have a lot of projects or build configurations, we recommend you avoid using the Default agent in order to free up the TeamCity server resources. The TeamCity Administrator can disable the default agent on the Agents page of the web UI.

Document generated by Confluence on Jun 16, 2008 13:43 Page 85 • When changing the TeamCity data directory or database make sure they do not get out of sync.

Configuring TeamCity data directory

The default placement of the TeamCity data directory can be changed. See corresponding section: TeamCity Data Directory for details.

Edit server configuration

• Accessing Server from Scripts • Authentication Settings • Build Script Interaction with TeamCity • Changing user password with default authentication scheme • Configuring Server URL • Configuring UTF8 Character Set for MySQL • Enabling Guest Login • Including Third-Party Reports in the Build Results • Mapping External Links in Comments • Using HTTPS to access TeamCity server

See also:

• Installation: Setting up and Running Additional Build Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 86 Setting up and Running Additional Build Agents

This page last changed on May 19, 2008 by yaegor.

Error formatting macro: toc: java.lang.NullPointerException Setting up and Running Additional Build Agents

Before you can start customizing projects and creating build configurations, you need to configure build agents.

Note If you install TeamCity bundled with a Tomcat servlet container, or opt to install an agent for Windows, both the server and one build agent are installed. This is not a recommended setup for production purposes, since the build procedure can slow down the responsiveness of the web UI and overall TeaMCity server functioning. If you need more build agents, perform the procedure described below.

To install a build agent, follow these general steps:

1. Open the Agents tab 2. Click the Install Build Agents link located in the top-right area of the page 3. In the Install Build Agents pop-up, choose one of the available installation options: • using Java Web Start • using MS Windows installer • manually via zip file 4. When an agent connects to the server for the first time, it appears on the Unauthorized agents tab under Agents, where administrators can authorize it. This will connect it to the server for the first time. Agents will not run builds until they are authorized and enabled. The agent running on the same computer as the server is authorized and enabled by default.

Please note that in order to run a TeamCity agent, the user under which account the agent runs, should have the following privileges:

• Log on as a service (to run as Windows service) • Start/Stop service (to run as Windows service, necessary for agent upgrade to work) • Debug programs (for take process dump functionality to work) • have write access to following directories: , , and

Installing Build Agents via Java Web Start

1. Make sure JDK 1.5+ is installed on the computer. 2. On the agent computer, set up the JAVA_HOME environment variable to point to the JDK 1.5+ installation directory. 3. Navigate to the Agents tab in the TeamCity web UI. 4. Click the "Install Build Agents" link and then click "Via Java Web Start". 5. Follow the instructions. Note You can install the build agent Windows service during the installation process or manually.

Installing Build Agents via a MS Windows installer

Run the agentInstaller.exe Windows Installer and follow the installation instructions.

Installing Build Agents via a zip file

1. Unzip the downloaded file into the desired directory.

Document generated by Confluence on Jun 16, 2008 13:43 Page 87 2. Make sure that you have a JDK or JRE installed (You will need JDK (not JRE) for some build runners like Ipr runner, Inspections, and Duplicates). Please ensure that the JRE_HOME or JAVA_HOME environment variables are set (pointing to the installed JRE or JDK directory respectively) for the shell in which the agent will be started. 3. Navigate to the \conf directory, locate the file called buildAgent.dist.properties and rename it to buildAgent.properties. 4. Edit the buildAgent.properties file and change the properties of the installed build agent: • serverUrl - URL of the TeamCity server (the one used to open web TeamCity UI). • name - name of the build agent that will be visible in the web UI. All agents connected to TeamCity server must have unique names. • ownPort - (not required) port number that agent use to accept connections from server. Please make sure there is no firewall blocking incoming connections to the port. The port must not be used by any other application installed on the computer. If you want to install several build agents on the same computer, make sure they are assigned different ports. • ownAddress - (not required) the IP address of the computer running build agent. Required only if automatic detection fails (e.g. if there are several network interfaces on the computer). 5. Under Linux, you may need to give execution permissions to the bin/agent.sh shell script. Note On Windows you may also want to install the build agent windows service instead of manual agent startup.

Starting the Build Agent

To start the agent manually, run the following script:

• for Windows: \bin\agent.bat start • for Linux and MacOS X: \bin\agent.sh start If you're running build agent on MacOS X and you're going to run Inspection builds, you may need to use the StartupItemContext utility:

sudo /usr/libexec/StartupItemContext agent.sh start

Stopping the Build Agent

To stop the agent manually, run the \agent script with a stop parameter.

Use stop to request stopping after current build finished. Use stop force to request immediate stop (if a build is running on the agent, it will be stopped abruptly (canceled)) Under Linux, you have one more option top use: stop kill to kill the agent process.

If the agent runs with a console attached, you may also press Ctrl+C in the console to stop the agent (if a build is running it will be canceled).

Installing and Running a Build Agent as a Windows Service

In Windows, you may want to use the build agent Windows service to allow the build agent to run without any user logged on.

Note to people upgrading from version 1.2

Since version 1.2, Build Agents are using a new Windows Service Library: Java Service Wrapper. The old service name, agentd, is no longer used in fresh installations. Agents that were already installed will continue to use old service until explicit installation. (more information)

To install the service:

Document generated by Confluence on Jun 16, 2008 13:43 Page 88 1. Make sure there is no TeamCity Build Agent Service or agentd service already installed. 2. Run the /bin/service.install.bat file.

To start the service:

• Run /bin/service.start.bat

To stop the service:

• Run /bin/service.stop.bat

The new service wrapper allows to change agent JVM parameters via standard way of Java Service Wrapper library. The configuration is located at \launcher\conf\wrapper.conf

The agent process name is TeamCityAgentService-windows-x86-32.exe. To work with net.exe utility, use TCBuildAgent name. For example:

net start TCBuildAgent

Service system account

To run builds, the build agent should be started under a user with enough rights for performing a build. By default, Windows service in started under SYSTEM ACCOUNT. To change it, use the Services applet (Control Panel|Administrative Tools|Services)

Installing Several Build Agents on the Same Machine

Several agents can be installed on a single machine. They function as separate agents and TeamCity works with them as different agents, not utilizing the fact that they share the same machine. After installing one agent you can install additional one, providing the following conditions are met:

• the agents are installed in the separate directories • they have distinctive "work" and "temp" directories • buildAgent.properties is configured to have different values for name and ownPort properties

Make sure, there are no build configurations that have absolute checkout directory specified (alternatively, make sure, such build configurations have "clean checkout" option turned ON.

Under Windows, to install the additional agents as services, modify \launcher \conf\wrapper.conf to change wrapper.console.title, wrapper.ntservice.name, wrapper.ntservice.displayname and wrapper.ntservice.description properties to have distinct name within the machine. See also

• Concepts: Build Agent • UI Reference: Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 89 Migrating to an External Database

This page last changed on May 15, 2008 by ivrina. Migrating to an External Database

By default, TeamCity runs using an internal database that uses the HSQLDB database engine. The internal database suits evaluation purposes since it works out of the box and requires no additional setup. However, we strongly recommend using an external database as a back-end TeamCity database in a production environment.

TeamCity 3.1 supports MySQL, Oracle, and PostgreSQL external databases.

Please refer to Setting up an External Database page for the database-specific configuration steps. If you want to start using external database from the first TeamCity start, these are the only steps you need.

If you were using TeamCity with the internal storage engine, there are two ways to switch to an external database:

• Switch with no data migration: build configurations settings will be preserved, but not the historical builds data or users. • Full Migration: all the data is preserved except Inspections and Duplicate build results (and any database-stored data provided by the third-party plugins). Database migration cannot be combined with server upgrade. If you want to upgrade at the same time, you should first upgrade (run the new version of TeamCity) and then migrate to another database. Switching to another database

To switch to another database without saving the build history or user data:

1. Install and set up an external database. 2. Shut down the TeamCity server. 3. Create a backup copy of the used by the server 4. Clean up the system folder: you must remove messages and artifacts folders from /system folder of your ; you may delete old HSQLDB files: buildserver.* to remove the no longer needed internal storage data. 5. Start the TeamCity server.

Full Migration

Please note that significant migration improvements were introduced between versions 3.0 in 3.1. Refer to the applicable description: 3.0 or 3.1.

This section provides descriptions of TeamCity migration to different types of external databases:

• Full Migration in TeamCity 3.0 • Full Migration in TeamCity 3.1

Full Migration in TeamCity 3.0

TeamCity 3.0.x supports migration only to MySQL database.

The target database must be empty before the migration process (it should NOT contain any tables).

To migrate all your existing data to an external database:

1. Shut the TeamCity server down. 2. Create a backup copy of the used by the server.

Document generated by Confluence on Jun 16, 2008 13:43 Page 90 3. Download the MySQL JDBC driver from: http://dev.mysql.com/downloads/connector/j/. 4. Place the MySQL driver into the TeamCity WEB-INF/lib folder. Further instructions assume the driver is named mysql-connector-java-5.0.5-bin.jar. 5. Run the export/import tool. 6. Move database.properties file to the config folder of your . This file is created when the database migration is successfully finished. 7. Copy a proper version.dat file to the system folder of your , overwriting the existing file. This file is also created when the migration is successfully finished. 8. Start the TeamCity server.

Running the Export/Import Tool

To start the export/import tool use the following commands from the TeamCity WEB-INF/lib folder:

• For Windows: You may use a command-line script that will perform a number of steps for you. To use it, navigate to the \bin directory, execute the migrateToMySQL.bat file, and follow the prompts. Alternatively, you can run the export/import tool manually:

SET CP=server.jar;openapi.jar;server-openapi.jar;mysql-connector-java-5.0.5- bin.jar;hsqldb.jar;dbunit-2.2.jar;common.jar;server-model.jar;log4j-1.2.12.jar;jdom.jar

java -Dfile.encoding=utf-8 -Xmx512m -cp %CP% jetbrains.buildServer.serverSide.HSQL2MySQL

• For Unix:

export CP=server.jar:openapi.jar:server-openapi.jar:mysql-connector-java-5.0.5- bin.jar:hsqldb.jar:dbunit-2.2.jar:common.jar:server-model.jar:log4j-1.2.12.jar:jdom.jar

java -Dfile.encoding=utf-8 -Xmx512m -cp $CP jetbrains.buildServer.serverSide.HSQL2MySQL

Depending on the location of your TeamCity data path there are three different sets of arguments to use with the export/import tool: • For the default location of the (i.e. /.BuildServer) use:

• For a non-default location of the use:

• For the standalone HSQLDB database use:

>cd TC\WEB-INF\lib >SET CP=server.jar;openapi.jar;mysql-connector-java-5.0.6- bin.jar;hsqldb.jar;dbunit-2.2.jar;common.jar;server-model.jar;log4j-1.2.12.jar;jdom.jar >java -Xmx512m -cp %CP% jetbrains.buildServer.serverSide.HSQL2MySQL \ jdbc:mysql://localhost/buildserver root root Thu Apr 05 12:45:58 MSD 2007 .BuildServer path: C:\Documents and Settings\user\.BuildServer Thu Apr 05 12:45:58 MSD 2007 Connecting to source database \ jdbc:hsqldb:file:C:\Documents and Settings\user\.BuildServer\system\buildserver Thu Apr 05 12:46:03 MSD 2007 Connecting to target database jdbc:mysql://localhost/buildserver

Document generated by Confluence on Jun 16, 2008 13:43 Page 91 Thu Apr 05 12:46:03 MSD 2007 Initializing schema... TABLES to be converted: (29) [agent, agent_sources_version, ....] Thu Apr 05 12:46:09 MSD 2007 Exporting data to C:\TEMP\TC-export56020 Thu Apr 05 12:46:10 MSD 2007 Importing data from C:\TEMP\TC-export56019 Thu Apr 05 12:46:13 MSD 2007 Exporting database.properties Thu Apr 05 12:46:13 MSD 2007 Exporting version.dat Thu Apr 05 12:46:13 MSD 2007 Done.

Additional information

• MySQL JDBC URL format:

jdbc:mysql://[:]/

Refer to this page for more information. • If you encounter an "out of memory" error, try increasing the number in the -Xmx512m parameter. On a 32-bit platform the maximum is about 1300 megabytes

Full Migration in TeamCity 3.1

TeamCity 3.1 supports HSQLDB, MySQL, Oracle, and PostgreSQL; the migration tool can move data between any of these databases.

Support of Microsoft SQL Server 2005 is also included in TeamCity 3.1, but it has "experimental" status.

The target database must be empty before the migration process (it should NOT contain any tables).

To migrate all your existing data to a new external database:

1. Set up an external database to be used by TeamCity. You can refer to Setting up an External Database for information on how to set up a TeamCity-specific. (At this point you should only create and configure the database, do not modify any TeamCity settings at this time). 2. Shut the TeamCity server down. 3. Create a backup copy of the used by the server 4. If the database driver is not bundled with TeamCity (refer the database properties table below, and place the appropriate driver into the TeamCity WEB-INF/lib directory. The following instructions refer to the driver as . 5. Edit the /bin/dbMigration.properties file, entering correct values for the source and target database. Ensure all the properties are supplied and only the necessary lines are uncommented (single-line comments are designated by # character) 6. Run the migration tool (see below) 7. Upon the successful completion of the database migration, a database.properties file will be created. Move this file into the config folder of your (this step is performed automatically by the migrateDB script) 8. Additionally a version.dat file will be created. Copy it to system folder of your , overwriting the existing file (this step is performed automatically by the migrateDB script) 9. Start TeamCity server. This should be the same TeamCity version that was run last time (TeamCity upgrade should be performed as a separate procedure).

Databases Properties Table

Sample dbMigration.properties file residing in the bin directory contains sections for several databases. DB Name Driver Class Name Driver jar Name Driver is Bundled JDBC URL format MySQL com.mysql.jdbc.Drivermysql-connector- no, download page jdbc:mysql:// java-5.0.8-bin.jar [:]/

Document generated by Confluence on Jun 16, 2008 13:43 Page 92 PostgreSQL org.postgresql.Driverpostgresql-8.2-505.jdbc3.jaryes jdbc:postgresql:// [:]/ Oracle oracle.jdbc.driver.OracleDriverojdbc14.jar no, download page jdbc:oracle:thin:@:: HSQLDB org.hsqldb.jdbcDriverhsqldb.jar yes jdbc:hsqldb:hsql:// [:]/

Running the Migration Tool

You can use the migrateDB.bat/migrateDB.sh script located in the \bin directory. Just run the script and follow the instructions.

Generally, you would need to run the script with single migrate parameter to perform the migration and move the generated configuration files into .

Additional information

• If you encounter an "out of memory" error, try increasing the number in the -Xmx512m parameter in the migrateDB script. On a 32-bit platform the maximum is about 1300 megabytes.

Alternative approach is to run HSQLDB in standalone mode via java -Xmx256M -cp ..\webapps\ROOT\WEB-INF\lib\hsqldb.jar org.hsqldb.Server -database.0 \system\buildserver -dbname.0 buildserver and then running the Migration tool pointing to the database as the source: jdbc:hsqldb:hsql:// localhost/buildserver sa ''

See also:

• Concepts: TeamCity Data Directory • Installation and Upgrade: TeamCity Data Backup | Setting up an External Database

Document generated by Confluence on Jun 16, 2008 13:43 Page 93 Setting up an External Database

This page last changed on Jun 06, 2008 by yaegor. Setting up an External Database

TeamCity 3.0 supports MySQL and PostgreSQL. Oracle support was added in TeamCity 3.1.

This document covers external database setup for the first use with TeamCity. If you evaluated TeamCity with internal database and want to preserve the data while switching to an external database, please refer to Migrating to an External Database guide.

In this section: Setting up MySQL Setting up PostgreSQL Setting up Oracle General Steps

1. If you already ran TeamCity but do not want to preserve any data, delete TeamCity Data Directory. All the data you entered into TeamCity will be lost. To preserve your data refer to the migration guide. 2. Run TeamCity with the default settings to create the . 3. Shutdown the TeamCity server. 4. Perform database-specific steps described below for MySQL, PostgreSQL or Oracle. 5. Start server.

Please note that TeamCity actively modifies its own database schema. The user account used by TeamCity should have permissions to create new, modify and delete existing tables in its schema, in addition to usual read/write permissions on all tables.

Setting up MySQL

1. Download the MySQL JDBC driver from: http://dev.mysql.com/downloads/connector/j/ 2. Put MySQL connector jar to the WEB-INF/lib directory of TeamCity web application 3. Create an empty database for TeamCity in MySQL and grant permissions to modify this database to a user from which TeamCity will work with this database. We recommend using UTF-8 character set for the database. Please consult this document for more details on how to create database with Unicode support. 4. In the /config folder rename database.mysql.properties file to database.properties and specify the required settings in this file:

connectionUrl=jdbc:mysql:/// connectionProperties.user= connectionProperties.password=

Setting up PostgreSQL

Supported PostgreSQL versions: 8+

1. Create an empty database for TeamCity in PostgreSQL and grant permissions to modify this database to a user from which TeamCity will work with this database. Be sure to set up it to use UTF8. 2. In the /config folder create file database.properties and specify the required settings in this file:

Document generated by Confluence on Jun 16, 2008 13:43 Page 94 driverName=org.postgresql.Driver connectionUrl=jdbc:postgresql:/// connectionProperties.user= connectionProperties.password= maxConnections=50 poolPreparedStatements=true

Setting up Oracle

Supported Oracle versions: 10g+

Oracle support is available only since TeamCity 3.1

1. Download the Oracle JDBC Thin driver from: http://www.oracle.com/technology/software/tech/java/ sqlj_jdbc/htdocs/jdbc_10201. 2. Put the driver jar (ojdbc14.jar) into the WEB-INF/lib directory of TeamCity web application 3. Create TeamCity user in Oracle database and grant permissions to modify this database to a user from which TeamCity will work with this database. 4. In the /config folder create file database.properties and specify the required settings in this file:

driverName=oracle.jdbc.driver.OracleDriver connectionUrl=jdbc:oracle:thin:@:1521: connectionProperties.user= connectionProperties.password= maxConnections=5 poolPreparedStatements=true

See also:

• Installation and Upgrade: Migrating to an External Database

Document generated by Confluence on Jun 16, 2008 13:43 Page 95 TeamCity Data Backup

This page last changed on Apr 29, 2008 by ivrina. TeamCity Data Backup

We strongly urge you to make the backup of TeamCity data before making any upgrade. Please note that TeamCity server does not support downgrading. Server Backup

Before performing the backup procedures, you need to stop the TeamCity server.

The following is needed to be backed up:

1. You may refer to TeamCity Data Directory section on the directory structure. Please note that you need to always back up the /system/ version.dat file, and ensure it is saved/restored in sync with other data files and the database data.

The /system/buildserver.* files store HSQLDB data. You should back them up if you use HSQLDB (a default setting). 2. Database data Database stores all information on the build results (except for artifacts and build logs), VCS changes, pinned builds, agents, build queue, user accounts, etc. • If you use HSQLDB (default, not recommended for production), the database is stored in the /system folder. All files from the directory can be backed up. Or refer to the HSQLDB backup notes. • If you use MySQL, please back up your database schema used by TeamCity. MySQL database connection settings are specified in the / config/database.properties file. See also corresponding installation section. 3. Application files You do not need to back up TeamCity application directory (web server alone with the web application), provided you still have original distribution package and you didn't: • place any custom libraries for TeamCity to use • install any non-default TeamCity plugins • make any startup script/configuration changes If you feel you need to back up the application files: • If you use non-war distribution: back up everything under except for temp and work directories. • If you use war distribution, pursue the backup procedure of the servlet container used. 4. Log files If you need TeamCity log files (which are mainly used for problem solving or debug purposes), back up /logs directory. You may also want to back up TeamCity Windows Service settings, if they were modified.

Build Agent's Data Backup

1. Build Agent configuration Back up the /conf/buildAgent.properties file. You may also wish to back up any other configuration files changed (Build Agent configuration is specified in /conf and /launcher/conf directories). 2. Log files If you need Build Agent log files (mainly used for problem solving or debug purposes), back up /logs directory. You may also wish to back up Build Agent Windows Service settings, if they were modified.

Document generated by Confluence on Jun 16, 2008 13:43 Page 96 Upgrade

This page last changed on May 04, 2008 by ivrina. Upgrading TeamCity

In this section: Upgrading the TeamCity Server

• Using a Windows Installer • Using a war or zip distribution package

Upgrading Build Agents

• Upgrading the Build Agent to 3.0 • Automatic Build Agent Upgrading Please back up your data before any upgrade and review the Upgrade Notes.

Licensing Issues

Upgrades to TeamCity versions up to versions 3.x are free of charge. Please note that TeamCity 3.x uses new licensing policy comparing to that of previous TeamCity versions. Please review the new Licensing Policy.

Upgrading Using a Windows Installer

1. Shut the server down. 2. Shut the agent down if it was installed from the TeamCity installation package. 3. Locate the .BuildServer folder on the disk and create a backup of this folder (usually this folder is created in the home directory of the user under which the TeamCity server is running). 4. Back up the configuration files in the TeamCity installation folder if you modified them or installed custom plugins. If you are upgrading from TeamCity 1.x, it is recommended to move your database settings from the /ROOT/WEB-INF/buildServerSpring.xml file in your backup to the database.properties file located in the TeamCity configuration data directory (/config). 5. Uninstall the previous installation using Add or Remove Programs. 6. Run the new installer. When prompted, specify the used by previous installation. 7. If you use an external database put the appropriate driver jar into the /ROOT/WEB-INF/lib directory. Refer to the following database properties table for more information. 8. If you use custom plugins, put their jars into /ROOT/WEB-INF/ lib for server-side plugins and into /ROOT/update/plugins for build agent plugins. 9. Start up the TeamCity server (and agent if it was installed together with the installer). 10. If your project contains build configurations related to *.ipr and inspections, you are required to update and correct the build configuration settings. To do it, visit the build configuration page/ build runner section. The first visit to this page may take time, because TeamCity will download and analyze all the project module (*.iml) files to detect which global libraries, path variables, jdk, etc. are used. Subsequent visits will be much faster. Review the settings and make sure that all the settings are correct. Manual Upgrading on Linux and for WAR Distributions

1. Shut the server down. 2. Locate the on the disk and create a back up of this folder (usually this folder is created in the home directory of the user under which the TeamCity server is running).

Document generated by Confluence on Jun 16, 2008 13:43 Page 97 3. Back up old TeamCity files (either the whole TeamCity directory or [TOMCAT_HOME]/webapps/ TeamCity/* if you are installing from a war file). If you are upgrading from TeamCity 1.x, it is recommended to move your database settings from the WEB-INF/buildServerSpring.xml file in your backup to the database.properties file located in the TeamCity configuration data directory (/ config). 4. Remove old installation files (either the whole TeamCity directory or [TOMCAT_HOME]/webapps/ TeamCity/* if you are installing from a war file). 5. Unpack the new archive where TeamCity was previously installed. 6. If you use an external database put the appropriate driver jar into the WEB-INF/lib directory. Refer to the following database properties table for more information. 7. If you use custom plugins, put their jars into ROOT/WEB-INF/lib for server-side plugins and into ROOT/update/plugins for build agent plugins. 8. Specify additional System Properties for Running the Server, if required. 9. Start up the TeamCity server. 10. If your project contains build configurations related to *.ipr and inspections, it is required to update and correct build configuration settings. To do it, visit the build configuration page/build runner section. The first visit to this page may take time, because TeamCity will download and analyze all project module (*.iml) files to detect used global libraries, path variables, jdk and so on. Subsequent visits will be much faster. Look through the settings and make sure that all settings are correct.

All the configuration data and database scheme will by updated by our converters upon the first startup after the upgrade.

Upgrading Build Agents to 3.0

When upgrading to TeamCity 3.0 for the first time there are two parts of the agent that need to be upgraded manually: the Windows service wrapper and the agent launcher. The easiest way to upgrade an agent is uninstall current build agent and then install the newer one.

Upgrading Build Agent Launcher

You only need to perform this step if you do not want to uninstall and then install the agent again, which is the preferred way of agent upgrade.

Agent launcher is the process that is first started for the agent and manages other child processes that actually connect to the server and perform the build.

1. Wait till agent is upgraded automatically. 2. Check \lib\latest folder. If it does not exist, no further steps are needed, you have the latest launcher version installed. 3. Stop agent. 4. Move content of the \lib\latest folder to the \lib folder, overwriting existing files, if needed. 5. Start the agent.

Upgrading the Build Agent Windows Service Wrapper

Upgrading from TeamCity version 1.x

Version 2.0 of TeamCity migrated to new way of managing Windows service (service wrapper) for the build agent: Java Service Wrapper library.

One of advantages of using new service wrapper is ability to change any JVM parameters of the build agent process.

1.x versions installed Windows service under name agentd, while 2.x versions use TeamCity Build Agent Service name.

Document generated by Confluence on Jun 16, 2008 13:43 Page 98 The service wrapper will not be migrated to new version automatically. You do not need to use the new service wrapper, unless you need its functionality (like changing agent JVM parameters).

To use new service wrapper you should uninstall old version of the agent (with Control Panel | Add/ Remove Programs) and then install a new one.

If you customized the user under which the service is started, do not forget to customize it in the newly installed service.

Upgrading from TeamCity version 2.x

If the service wrapper needs an update, the new version is downloaded into the / launcher.latest folder, however the changes are not applied automatically.

To upgrade the service wrapper manually, do the following:

1. Ensure the /launcher.latest folder exists. 2. Stop the service using \bin\service.stop.bat. 3. Uninstall the service using service.uninstall.bat. 4. Backup /launcher/conf/wrapper.conf file. 5. Delete /launcher. 6. Rename /launcher.latest to /launcher. 7. Edit /launcher/conf/wrapper.conf file. Check that the 'wrapper.java.command' property points to the java.exe file. Leave it blank to use registry to lookup for java. Leave 'java.exe' to lookup java.exe in PATH. For a standalone agent the service value should be ../jre/bin/java, for and agent installation on the server the value should be ../../jre/bin/java. The backup version of wrapper.conf file may be used. 8. Install the service using \bin\service.install.bat. 9. Make sure the service is running under the proper user account. Please note that using SYSTEM can result in failing builds which use MSBuild/Sln2005 configurations. 10. Start the service using \bin\service.start.bat. Warning This procedure is applicable ONLY for an agent running with new service wrapper. Make sure you are not running the agentd service.

Automatic Build Agent Upgrading

Starting with TeamCity 3.0, the core components and plugins for build agents are updated automatically. When the TeamCity server is upgraded, agents will automatically update themselves. The Agent (agent.bat, agent.sh, or agent service) will download the latest agent upgrade from the TeamCity server. When the download is complete and the agent is idle, it will start the upgrade process (the agent is stopped, the agent files are updated, and agent is restarted). This process may take about five minutes. It is important not to interrupt the upgrade process, doing so may cause the upgrade to fail and the agent will need to be manually reinstalled.

Do not close the console or restart the agent process during the upgrade! Notes on upgrading versions prior to 3.0.1: After agent.bat is launched, a command prompt console opens and then disappears while the agent files are updated. The console will reappear after the upgrade is complete and the agent restarts. Be patient, it can take around five minutes. Restarting the agent during this time may cause the upgrade to fail and the agent will need to be manually reinstalled. Since 3.0.1: The various console windows will open and close during the agent upgrade. Closing certain console windows may cause the upgrade to fail, and the agent will need to be manually reinstalled.

Document generated by Confluence on Jun 16, 2008 13:43 Page 99 Upgrade Notes

This page last changed on Apr 01, 2008 by ivrina. Upgrade Notes

From 3.1 to 3.1.1

No noteworthy changes From 3.0.1 to 3.1

Guest User and Agent Details

Starting from version 3.1, the Guest user does not have access to the agent details page. This has been done to reduce exposing potentially sensitive information regarding the agents' environment. In the Enterprise Edition, the Guest user's roles can be edited to provide the needed level of permission.

StarTeam Support

Working Folders in Use

Since version 3.1 when checking out files from a StarTeam repository TeamCity builds directory structure on the base of the working folder names, not just folder names as it was in earlier versions. So if you are satisfied with the way TeamCity worked with StarTeam folders in version 3.0, ensure the working folders' names are equal to the corresponding folder names (which is so by default).

Also note, that although StarTeam allows using absolute paths as working folders, TeamCity supports relative paths only and doesn't detect absolute paths presence. So be careful and review your configuration.

StarTeam URL Parser Fixed

In version 3.0 a user must have followed a wrong URL scheme. It was like starteam://server:49201/ project/view/rootFolder/subfolder/... and didn't work when user tried to refer a non-default view. In version 3.1 the native StarTeam URL parser is utilized. This means you now don't have to specify the root folder in the URL, and the previous example should look like starteam://server:49201/project/view/ subfolder/... From 3.0 to 3.0.1

Linux Agent Upgrade

• Due to an issue with Agent upgrade under Linux, Agent auxiliary Launcher processes may have been left running after agent upgrades. Versions 3.0.1 and up fix the issue. To get rid of the stale running processes, after automatic agent upgrade, please stop the agent (via agent.sh kill command) and kill any running java jetbrains.buildServer.agent.Launcher processes and start the agent again. From 2.x to 3.0

Incompatible changes

Please note that TeamCity 3.0 introduces several changes incompatible with TeamCity 2.x:

• build.working.dir system property is renamed to teamcity.build.checkoutDir. If you use the property in you build scripts, please update the scripts. • runAll.bat script now accepts a required parameter: start to start server and agent, stop to stop server and agent.

Document generated by Confluence on Jun 16, 2008 13:43 Page 100 • Under Windows, agent.bat script now accepts a required parameter: start to start agent, stop to stop agent. Note that in this case agent will be stopped only after it becomes idle (no builds are run). To force immediate agent stopping, use agent.bat stop force command that is available under both Windows and Linux (agent.sh stop force). Under Linux you can also use agent.sh stop kill command to stop agents not responding to agent.sh stop force.

Build working directory

Since TeamCity 3.0 introduces ability to configure VCS roots on per-Build Configuration basis, rather then per-Project, the default directory in which build configuration sources are checked out on agent now has generated name. If you need to know the directory used by a build configuration, you can refer to /work/directory.map file which lists build configurations with the directory used by them. See also Build Checkout Directory

User Roles when upgrading from TeamCity 1.x/2.x/3.x Professional to 3.x Enterprise

When upgrading from TeamCity 1.x/2.x/3.x Professional to 3.x Enterprise for the first time TeamCity's accounts will be assigned the following roles by default:

• Administrators become System Administrators • Users become Project Developers for all of the projects • The Guest account is able to view all of the project • Default user roles are set to Project Developer for all of the projects

See also:

• Licensing Policy • Editions

Document generated by Confluence on Jun 16, 2008 13:43 Page 101 Installing Tools

This page last changed on Nov 26, 2007 by chamilton. Installing Tools

TeamCity has a number of add-ons that provide seamless integration with various IDEs and greatly extend their capabilities with features like personal builds and pre-tested commit.

• Eclipse Plugin • IntelliJ IDEA Plugin • Syndication Feed • Visual Studio Plugin • Windows Tray Notifier

Document generated by Confluence on Jun 16, 2008 13:43 Page 102 Eclipse Plugin

This page last changed on May 04, 2008 by ivrina. Installing the TeamCity Plugin for Eclipse

Make sure you have Subclipse plugin installed before installing TeamCity plugin. Otherwise, on installing Subclipse after TeamCity plugin, you may experience an "Unable to create view: org/tigris/ subversion/subclipse/core/IResourceStateChangeListener" error. If you get this error, restart Eclipse using a "-clean" command-line option to avoid the error. Prerequisites

• Subclipse 1.2.x plugin: The current version of the Eclipse plugin only supports Remote Run and Pre-tested Commit for the Subversion Version Control System. You need to have Subclipse 1.2.x installed in Eclipse (update site for Subclipse 1.2). Please refer to the Eclipse plugin installation procedure for Subclipse plugin at http://subclipse.tigris.org/install.html. • JDK 1.5: Eclipse must be run under JDK 1.5 for the TeamCity plugin to work.

To install the TeamCity plugin for Eclipse:

1. Navigate to the My Settings and Tools page in the TeamCity UI and locate the TeamCity Tools section. 2. Under Eclipse plugin header, copy the update site link URL. For example, in Internet Explorer you can right-click the link and choose Copy shortcut on the context menu. 3. In Eclipse, choose Help | Software Updates | Find and Install on the main menu. The Install Feature Updates dialog appears. 4. Select the Search for new features to install option and click next. 5. Click the New Remote Site button. 6. Enter a name (for example TeamCity Plugin), paste the URL copied above (http:///update/eclipse/) into the URL field of the new update site in Eclipse, and click OK. 7. Click Finish and follow the installation instructions.

For detailed instructions on how to work with the plugin, refer to the TeamCity section of Eclipse's help system.

See also:

• UI Reference: My Settings And Tools

Document generated by Confluence on Jun 16, 2008 13:43 Page 103 IntelliJ IDEA Plugin

This page last changed on Jan 22, 2008 by yaegor.

Installing the Plugin for IntelliJ IDEA

Installing the Plugin from the Plugin Repository

To install the TeamCity plugin for IntelliJ IDEA:

1. In IntelliJ IDEA, open the Settings dialog. Press (Ctrl+Alt+S) or choose (File | Settings...) from the main menu. 2. Click the Plugin button under IDE Settings to invoke the plugin dialog. 3. On the Plugin dialog, click the Available tab to view a list of available plugins. 4. Scroll down and highlight the JetBrains TeamCity Plugin, click the button, and click OK. 5. Restart IntelliJ IDEA.

Note Please note that the plugin repository plugin version corresponds to TeamCity 3.0 version. If you have later TeamCity server version, please navigate to TeamCity menu in the IntelliJ IDEA and invoke Update command to install the plugin version matching the server version. Manually Installing the Plugin

The plugin for IntelliJ IDEA can be downloaded from the TeamCity Tool area on the My Settings & Tools page.

To install the TeamCity plugin for IntelliJ IDEA:

1. Navigate to the My Settings & Tools page. Under the IntelliJ IDEA Plugin section in the TeamCity Tools area, click the download link, and save the archive. 2. Make sure that IntelliJ IDEA is not running and unzip the archive into the IntelliJ IDEA user plugins directory at: • Windows: C:\Documents and Settings\\.IntelliJIdea70\config\plugins • OS X: $HOME/Library/Application Support/IntelliJIDEA70 • Linux/Unix: $HOME/.IntelliJIdea70/config/plugins

Note After you have installed a newer version of the plugin, you cannot rollback to its previous version. Additional information on how to work with TeamCity plugin is available in IntelliJ IDEA Help System (shipped with IntelliJ IDEA).

Document generated by Confluence on Jun 16, 2008 13:43 Page 104 Syndication Feed

This page last changed on Nov 29, 2007 by chamilton. Syndication Feed

To configure a syndication feed for obtaining information about the builds of certain build configurations:

1. In the TeamCity Tools section, click the Customize link. 2. In the Feed URL Generator page specify the build configurations and events (builds and/or changes) you want to be notified about, and define authentication settings. 3. Copy the Feed URL, generated by TeamCity, to your feed reader, or click Subscribe. 4. Preview summary of subscription and click Subscribe now.

See also:

• Concepts: RSS Feed • UI Reference: Feed URL Generator page

Document generated by Confluence on Jun 16, 2008 13:43 Page 105 Visual Studio Plugin

This page last changed on Jan 21, 2008 by chamilton. Visual Studio Plugin

The TeamCity plugin for Microsoft Visual Studio 2005/2008 provides the following features:

• remote run (TFS and Subversion only) • pre-tested commit (TFS and Subversion only) • navigation to build results • viewing failed NUnit/TFS unit test stack traces • viewing the results of the integration of your changes into the project code base

For detailed instructions on how to use the plugin, refer to the TeamCity Help section, embedded in Microsoft Visual Studio's Help System.

Note

In order to enable navigation to the failed NUnit/TFS unit tests in Visual Studio by clicking the links in the Web UI, make sure that .pdb file generation for the assemblies involved in NUnit/TFS unit tests is switched on. Installing the Plugin

Download and install the plugin available in the TeamCity Tools section of the My Settings and Tools page and follow the installation wizard.

Requirements

• The TeamCity plugin for Microsoft Visual Studio requires Microsoft Visual Studio 2005/2008. • To use the remote run and pre-tested commit features with TFS, Team Explorer must be installed. Refer to MSDN documentation for information on installing Team Explorer. • To use these features with Subversion, use the Subversion command-line client version 1.4.0 or later.

Document generated by Confluence on Jun 16, 2008 13:43 Page 106 Windows Tray Notifier

This page last changed on Dec 04, 2007 by mio.

Windows Tray Notifier

The Windows Tray Notifier is a utility that helps you to stay up-to-date with your team's software building process. With the Windows Tray Notifier you:

• are always logged in to TeamCity, • receive notifications only about specific events, • monitor desired projects in the Windows Tray. Installing the Windows Tray Notifier

To install the Windows Tray Notifier:

1. Navigate to the My Settings & Tools page, and, in the TeamCity Tools area, click the download link under Windows tray notifier. 2. Wait until the plugin downloads completely. 3. Run the TrayNotifierInstaller.msi file. Working with the Windows Tray Notifier

After installing the Windows Tray Notifier, you can continue working in the IDE but effortlessly stay-up-to date with the most recent changes in the project code base using the notifier's various elements:

• The Notifier Icon • The TeamCity Quick View Window • Windows Tray Popup Alerts • Right-Click Functionality Tip You can customize your watched projects and build configurations to help avoid information overload and change the information available in the quick view window: ° - Right-click the Notifier Icon and select Configure Watched Builds. You will be directed to TeamCity's Windows tray notifier settings page where you can: - Select the desired build configurations and events on which you want to be notified.

The Notifier Icon

The Notifier icon appears in Windows System Tray as soon as you launch the Windows Tray Notifier. It shows the status of projects which you (or your TeamCity Administrator) have selected to monitor. The status icon changes to reflect the state of watched projects and build configurations. Here is a list of possible states of the build configurations.

Icon Meaning Build is successful Build failed and nobody has taken responsibility Some team member has taken responsibility for the build failure The person responsible for the build failure has submitted a fix, but the build has not executed successfully yet Build configuration is paused, and builds are not triggered automatically The Notifier icon always shows the status of the last completed build of the your watched project or build configurations, unless you selected Notify when the first error occurs on the Windows

Document generated by Confluence on Jun 16, 2008 13:43 Page 107 Tray Notifier settings page. In this case, the Notifier icon does not wait for the failing build to finish, it displays a failed icon as soon as the running build fails a test.

The TeamCity Quick View Window

A click on the status icon opens the TeamCity Quick View window.

Click the results or changes links to navigate to the Build Results and Changes pages in TeamCity's web interface, respectively.

Windows Tray Popup Alerts

Windows tray popup alerts display brief build results information for the specified build configurations and notification events.

Click the link on the popup to go the build results page for more details.

Right-Click Functionality

Right-clicking the icon gives you quick access to all of the Windows Tray Notifier's functions.

Option Description Open Quick View Window Displays the Quick View Window

Document generated by Confluence on Jun 16, 2008 13:43 Page 108 Go to Projects page... Opens the Projects tab. Go to My Changes page... Opens the My Changes tab Configure Watched Builds... Opens the Windows Tray Notifier settings page. Tip: Avoid information overload and customize the quick view window by editing your settings on this page. Auto Upgrade Select this option to allow the program to automatically upgrade itself. Run on Startup Select this option to automatically launch the program when windows boots. About Displays the information on the program's splash screen. Logout Use this function to log out of the TeamCity server. This will allow you to a different one. Exit Quits the program

See also:

• Concepts: Notification Conditions | Notification Rules • Administrator's Reference: Notifier Templates Configuration • UI Reference: Notifier Settings

Document generated by Confluence on Jun 16, 2008 13:43 Page 109 System Administrator Reference

This page last changed on Nov 08, 2007 by mio. System Administrator Reference

• Configuring the Server • Enabling the Status Widget for Build Configurations • Enterprise License Expiration • Logs of Internal Events • Managing Projects • Notifier Templates Configuration • Patterns For Accessing Build Artifacts • System Properties for Running the Server • System Properties of a Build Configuration • Third-Party License Agreements • Troubleshooting

Document generated by Confluence on Jun 16, 2008 13:43 Page 110 Configuring the Server

This page last changed on Apr 24, 2008 by ivrina. Configuring the Server

Server configuration is only available to the System Administrators.

To edit server configuration:

1. In the Administration page, click the link Edit Server Configuration. 2. In the Edit Server Configuration page, you can: • View and ; • Specify the server URL; • View the current authentication scheme, configure the welcome message and enable or disable anonymous login. Authentication scheme can be configured manually, as described in the section Authentication Settings • Configure email and Jabber notification settings.

Also in this part:

• Accessing Server from Scripts • Authentication Settings • Build Script Interaction with TeamCity • Changing user password with default authentication scheme • Configuring Server URL • Configuring UTF8 Character Set for MySQL • Enabling Guest Login • Including Third-Party Reports in the Build Results • Mapping External Links in Comments • Using HTTPS to access TeamCity server

Document generated by Confluence on Jun 16, 2008 13:43 Page 111 Accessing Server from Scripts

This page last changed on Dec 06, 2007 by yaegor. Accessing Server from Scripts

The TeamCity server supports basic HTTP authentication allowing to access certain web server pages and perform actions from various scripts.

Use valid TeamCity server username and password to authenticate using basic HTTP authentication.

You may want to configure the server to use HTTPS as username and password are passed in clear text during basic HTTP authentication.

To use a basic HTML authentication instead of redirecting to the login page, prepend a path in usual TeamCity URL with "/httpAuth". For example: http://buildserver:8111/httpAuth/action.html?add2Queue=bt7

The HTTP authentication can be useful when downloading build artifacts and triggering a build.

If you have Guest user enabled, it can be used to perform the action too. Use "/guestAuth" before thr URL path to perform the action on Guest user behalf. For example: http://buildserver:8111/guestAuth/action.html?add2Queue=bt7

In TeamCity Enterprise version, please make sure the user used to perform the authentication (or Guest user) has appropriate role to perform the necessary operation.

Triggering a Build From Script

To trigger a build, send the HTTP GET request for the URL: http:///httpAuth/ action.html?add2Queue= performing basic HTTP authentication.

Some tools (for example, Wget) support the following syntax for the basic HTTP authentication: http://:@/httpAuth/action.html?add2Queue=

Example: http://testuser:[email protected]/httpAuth/action.html?add2Queue=bt10

Since TeamCity 3.0, you can trigger a build on a specific agent passing additional agentId parameter with the agent's Id. You can get the agent Id from the URL of the Agent's details page. For example, you can infer that agent's Id equals "2" if it's details page has the following URL: http://teamcity.jetbrains.com/agentDetails.html?id=2

To trigger a build on two agents at the same time, use the following URL: http://testuser:[email protected]/httpAuth/action.html? add2Queue=bt10&agentId=1&agentId=2

Document generated by Confluence on Jun 16, 2008 13:43 Page 112 Authentication Settings

This page last changed on May 07, 2008 by ivrina. Authentication Settings

Out-of-the-box TeamCity Enterprise edition supports three authentication schemes:

• Default Authentication (cross-platform) • Windows Domain Authentication (Windows platforms only) ° Windows Domain Authentication on Unix-like computers ( Only available in TeamCity 3.1) • LDAP Authentication (cross-platform)

TeamCity Professional edition only supports TeamCity Default Authentication. Active authentication scheme is configured in the auth-type section of the main-config.xml file located in the /config directory, for example:

Welcome to TeamCity, your team building environment!

Authentication type is defined by the login module, welcome message and the possibility to use anonymous login. Built-in login modules are:

• jetbrains.buildServer.serverSide.impl.auth.DefaultLoginModule for Default Authentication • jetbrains.buildServer.serverSide.impl.auth.NTDomainLoginModule for Windows Domain Authentication • jetbrains.buildServer.serverSide.impl.auth.LDAPLoginModule for LDAP Authentication TeamCity extensibility note: Any implementation of javax.security.auth.spi.LoginModule can be used, provided it is registered via jetbrains.buildServer.serverSide.auth.LoginModuleDescriptor bean.

Default Authentication

Configuration of TeamCity Data Directory/config/main-config.xml:

Welcome to TeamCity, your team building environment!

Users database is maintained by TeamCity. New users are added by TeamCity administrator (in administration area section) or user are self-registered if tag is specified.

Document generated by Confluence on Jun 16, 2008 13:43 Page 113 Windows Domain Authentication

Configuration of TeamCity Data Directory/config/main-config.xml:

Welcome to TeamCity, your team building environment!

Prior to TeamCity 3.1, Windows Domain Authentication was supported only if TeamCity server was installed under Windows 2000, Windows XP or Windows Server 2003. See below for the features introduced in 3.1.

Prior to TeamCity 3.1, all Windows domain users that can log on to the machine running TeamCity server can also log in into TeamCity using the same credentials.

To log in to TeamCity users should provide their user name in the form DOMAIN\user.name and their domain password. TeamCity 3.1 also supports logging in using @ syntax. It is also possible to log in using only a username if the domain is added to the TeamCity Data Directory/ config/ntlm-config.properties file.

Windows Domain Authentication on Unix-like Computers (TeamCity 3.1 Only)

Support for Windows Domain Authentication on Unix-like computers is available in TeamCity 3.1. For this to work, check the /config/ntlm-config.properties file and make sure the following line is commented out.

# ntlm.compatibilityMode=true

Please refer to the http://jcifs.samba.org/src/docs/api/ page for information about other supported properties.

If you want to use the NT domain authentication available in TeamCity version prior to 3.1, ensure the line ntlm.compatibilityMod=true is present and not commented in the ntlm-config.properties file.

LDAP Authentication

Configuration of /config/main-config.xml:

Welcome to TeamCity, your team building environment!

Authentication is performed by direct login into LDAP with credentials entered into the login form.

Environment for initial context is initialized with java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory and then all properties from /config/ldap-config.properties file are loaded. Refer to the http:// java.sun.com/products/jndi/tutorial/ldap/security/ldap.html page for more information about property names and values.

Use the LDAP explorer to browse LDAP directory and verify the settings (i.e.http://www.jxplorer.org/).

Document generated by Confluence on Jun 16, 2008 13:43 Page 114 You can also specify multiple servers using the following pattern: java.naming.provider.url="ldap://ldap.mycompany.com:389 ldap://ldap2.mycompany.com:389 ldap:// ldap3.mycompany.com:389"

Active Directory

The following template enables authentication against active directory:

Add the following code to the /config/ldap-config.properties file. java.naming.referral=follow java.naming.provider.url=ldap://main.labs.intellij.net:389/CN=users,DC=Labs,DC=IntelliJ,DC=Net java.naming.security.authentication=simple

Non-AD LDAP server issues

By default login format is restricted to DOMAIN\sAMAccountName (i.e. "LABS\alexey.gopachenko"). But since version 2.1 you can override this restriction by adding property loginFilter, value is java.util.RegEx expression to match against. (I.e. loginFilter=.+ will accept any non-empty login).

OpenLDAP users can benefit from formatDN property. If formatDN is defined then it is used as user DN with $login$ substring replaced with anyting what user enters into login field, i.e formatDN=uid=$login$,ou=people,dc=company,dc=com

See also:

• UI Reference: Administration

Document generated by Confluence on Jun 16, 2008 13:43 Page 115 Build Script Interaction with TeamCity

This page last changed on May 30, 2008 by yaegor. Build Script Interaction with TeamCity

If TeamCity doesn't support your testing framework or build runner out of the box, it is still possible to reap the many of benefits that TeamCity provides by customizing your build scripts to interact with the TeamCity server. This makes a wide range of features available to any team regardless of their testing frameworks and runners. Some of these features include displaying real-time test results and customized statistics, changing the build's status, and publishing artifacts before the build is finished.

In this section:

• Service Messages ° Reporting tests ° Publishing artifacts while the build is still in progress ° Reporting build progress ° Reporting build status ° Reporting build number ° Reporting build statistics • teamcity-info.xml ° Modifying the build status ° Reporting and displaying custom statistics

Service Messages

Service messages are used to pass commands/build information to TeamCity server from the build script. In order to be processed by TeamCity they should be printed into standard output stream of the build (otherwise, if the output is not in the service message syntax, it should appear in the build log).

Service messages support two formats:

• Message and single parameter:

##teamcity[message 'value']

• Message and multiple parameters:

##teamcity[message name1='value1' name2='value2']

Multiple parameters message can more formally be described as:

##teamcity[messageNameWSPpropertyNameOWSP=OWSP'value'WSPpropertyName_IDOWSP=OWSP'value'...OWSP]NEWLINE

Where:

• messageName is a name of the message. See below for supported messages. The message name should be a valid Java id (only alpha-numeric characters and "-", starting with a alpha character) • propertyName is a name of the message attribute. Should be a valid Java id. • value is a value of the attribute preceding it. Should be an escaped value (see below). • WSP is a required whitespace(s): space or tab character (\t) • OWSP is an optional whitespace(s) • NEWLINE is a newline character(s): \n or \r • ... is any number of WSPpropertyNameOWSP=OWSP'_value'_ blocks

Document generated by Confluence on Jun 16, 2008 13:43 Page 116 For escaped values, TeamCity uses a vertical bar "|" as an escape character. In order to have certain characters properly interpreted by the TeamCity server they must be preceded by a vertical bar. For example, the following message:

##teamcity[testStarted name='foo|'s test'] will be displayed in TeamCity as 'foo's test'. Please see the table below.

Character Should be escaped as ' (apostrophe) |' \n (line feed) |n \r (carriage return) |r | (vertical bar) || ] (closing bracket) |] Each message should be followed by a newline.

Reporting Tests

As TeamCity reports tests results on-the-fly, every testing framework needs its own support for this feature to work. If TeamCity doesn't support your testing framework or build runner, it is possible to modify your build script to send this information to the TeamCity server using service messages that are sent via the standard output of the build process. This makes it possible to display test results in real- time, make test information available on the Tests tab of the Build Results page, and publish artifacts while the build is still in progress.

Here is the list of supported test service messages:

Test suite messages:

##teamcity[testSuiteStarted name='suite.name'] ##teamcity[testSuiteFinished name='suite.name']

All the individual test messages should appear between testSuiteStarted and testSuitFinished (in that order) with the same name attributes.

Individual test messages:

##teamcity[testStarted name='testname'] ##teamcity[testFinished name='testname']

Indicates that the test "testname" was run. If testFailed message is not present, the test is regarded as successful. All the other test messages (except testIgnored) with the same name attribute should appear between the testStarted and testFinished (in that order).

##teamcity[testIgnored name='testname' message='ignore comment']

Indicates that the test "testname" is present but was not run (was ignored).

##teamcity[testStdOut name='testname' out='text'] ##teamcity[testStdErr name='testname' out='text']

Test output reporting (to be shown as the test result if the test fails). A test should have no more then one testStdOut and one testStdErr message. The messages should appear inside testStarted and testFinished messages with the matching name attribute.

##teamcity[testFailed name='testname' message='failure message' details='stack trace']

Document generated by Confluence on Jun 16, 2008 13:43 Page 117 ##teamcity[testFailed type='comparisonFailure' name='testname' message='failure message' details='stack trace' expected='expected value' actual='actual value']

Indicates that the test with the name name has failed. Only one testFailed messages should appear for a given test name. actual and expected attributes can be used for reporting comparison failure. The values will be used when opening the test in the IDE. The messages should appear inside testStarted and testFinished messages with the matching name attribute.

Publishing Artifacts while the Build is Still in Progress

Another cool feature of service messages is that now you can publish build artifacts, while the build is still running. Just output the following line:

##teamcity[publishArtifacts '']

And the files matching the will be uploaded and visible as artifacts of the running build.

Publishing artifacts process can affect the build because it consumes network traffic and some disk/ CPU resources (should be pretty negligible for not large files/directories).

Artifacts that are specified in the build configuration setting will be published as usual.

Reporting build progress

You can use special progress messages to mark long-running parts in a build script. These messages will be shown on the projects dashboard for corresponding build and on the build results page.

To log single progress message use:

##teamcity[progressMessage '']

This progress message will be shown until another progress message occurs or until next target starts (in case of Ant builds).

If you wish to show progress message for a part of a build only you can use:

##teamcity[progressStart ''] ...some build activity... ##teamcity[progressFinish '']

The same message should be used for both progressStart and progressFinish. This allows nesting of progress blocks. Also note that in case of Ant builds progress messages will be replaced if Ant target starts.

In previous TeamCity versions (< 3.1) we used other format for the progress messages. If for some reason you cannot modify your build scripts to support new format you can install this plugin: deprecated-progress.jar. This jar file should be copied to the TeamCity WEB-INF/lib directory and TeamCity server must be restarted after that.

Reporting Build Status

TeamCity allows user to change the build status directly from the build script. To set the status and change the text of the build status (e.g. note the number of failed tests if the test framework is not supported by TeamCity), use the buildStatus message with the following format:

Document generated by Confluence on Jun 16, 2008 13:43 Page 118 ##teamcity[buildStatus status='' text='{build.status.text} and some aftertext'] where:

• The status attribute may take following values: FAILURE, SUCCESS, NORMAL, ERROR. • {build.status.text} is an optional substitution pattern which represents the status, calculated by TeamCity automatically using passed test count, compilation messages and so on. The status, which is set using such attribute, will be presented while build is running and will affect final build results.

Reporting Build Number

To set a custom build number directly, specify a buildNumber message using the following format:

##teamcity[buildNumber '']

In the value, you can use the {build.number} attribute to show the current build number provided by TeamCity. For example:

##teamcity[buildNumber '1.2.3_{build.number}-ent']

Reporting Build Statistics

In TeamCity, it is possible to provide custom graphs. But before describing a custom graph you need to report related build statistics. You can publish the build statics values in two ways:

• Using a service message in a build script directly • Providing data using the teamcity-info.xml file

To report build statistics using service messages:

• Specify a 'buildStatisticValue' service message with the following format for each statistics value you want to report:

##teamcity[buildStatisticValue key='' value='']

TeamCity-info.xml

It is also possible to have the build script collect information, generate an XML file called teamcity- info.xml in the root build directory. When the build finishes, this file will automatically be uploaded as a build artifact and processed by the TeamCity server.

Modifying the Build Status

TeamCity has the ability to change the build status directly from the build script. You can set the status (build failure or success) and change the text of the build status (e.g. note the number of failed tests if the test framework is not supported by TeamCity).

XML schema for teamcity-info.xml

It is possible to set the following information for the build:

• Build number — Sets the new number for the finished build. You can reference the TeamCity- provided build number using {build.number}. • Build status — Change the build status. Supported values are "FAILURE" and "SUCCESS".

Document generated by Confluence on Jun 16, 2008 13:43 Page 119 • Status text — Modify the text of build status. You can replace the TeamCity-provided status text or add a custom part before or after the standard text. Supported action values are "append", "prepend" and "replace".

Example teamcity-info.xml file:

fitnesse: 45 coverage: 54%

It is up to you to figure out how to retrieve test results that are not supported by TeamCity and accurately add them to the teamcity-info.xml file.

Reporting and Displaying Custom Statistics

It is possible to provide custom graphs in TeamCity. Custom graphs are shown at the end of Statistics tab of build configuration page. There is no need to develop any additional TeamCity plugins, just provide the data in the TeamCity-info.xml file and organize the graph.

To create a custom graph:

1. [Have the build script provide the statistics data using service messages in the build script or the teamcity-info.xml file. 2. Describe your graphs using main-config.xml file.

Providing data using the teamcity-info.xml file

This file should be created by the build in the root directory of the build. You can publish multiple statistics (see the details on the data format below) and create separate graphs for each set of values.

The teamcity-info.xml file should contain code in the following format (you can combine various data in the teamcity-info.xml file):

Describing graphs using the main-config.xml file

Add the following lines of code within the tag of the /config/ main-config.xml file:

Document generated by Confluence on Jun 16, 2008 13:43 Page 120 Changing user password with default authentication scheme

This page last changed on May 12, 2008 by pavel.sher. Changing user password with default authentication scheme and database

The following procedure is suitable for default authentication scheme and default database (HSQLDB) only.

To change user password:

1. Switch to the /webapps/ROOT/WEB-INF/lib directory 2. Invoke the following command:

java -cp server.jar;hsqldb.jar ChangePassword

You can skip the option, if you are using default path for TeamCity data files: /.BuildServer

Document generated by Confluence on Jun 16, 2008 13:43 Page 121 Configuring Server URL

This page last changed on Apr 09, 2008 by ivrina. Configuring Server URL

Starting from TeamCity 3.0 server URL can be modified right from the Administration -> Server configuration page.

In most cases TeamCity correctly autodetects its own URL and uses it for constructing URLs in notification messages. But sometimes it is impossible, for example, the server might be running on HTTP and HTTPS or it might be hidden behind the Apache web server. For such cases you can specify server URL in the main-config.xml file (no server restart is required after the change):

This URL will be used when URLs in notification messages are constructed.

Document generated by Confluence on Jun 16, 2008 13:43 Page 122 Configuring UTF8 Character Set for MySQL

This page last changed on Apr 29, 2008 by ivrina. Configuring UTF8 Character Set for MySQL

To create a MySQL database which uses the utf8 character set:

1. Create a new database:

CREATE DATABASE DEFAULT CHARACTER SET utf8

2. Open /config/database.properties, and add the characterEncoding property:

connectionProperties.characterEncoding=UTF-8

To change the character set of an existing MySQL database to utf8:

1. Shut the TeamCity server down. 2. Dump the database data to the file dump_data.:

mysqldump -t -u -p >dump_data.sql;

3. Dump the database schema to the file dump_schema.sql:

mysqldump - -u -p >dump_schema.sql

4. Edit dump_schema.sql. Remove DEFAULT CHARSET= from the table and column definitions. 5. Create a new database with uft8 as the default character set:

CREATE DATABASE DEFAULT CHARACTER SET utf8; 6. Import dump_schema.sql into the new database:

mysql -u -p

mysql -u -p /config/database.properties file as follows: • change connectionUrl property to:

jdbc:mysql:/// • add characterEncoding property:

connectionProperties.characterEncoding=UTF-8

Document generated by Confluence on Jun 16, 2008 13:43 Page 123 Enabling Guest Login

This page last changed on Nov 07, 2007 by mio. Enabling Guest Login to TeamCity

To enable guest login to TeamCity:

1. Navigate to Administration page and click Edit server settings link. 2. Select Allow to login as a guest user option. The Login as a guest user link appears on the Login page. Notes • Alternatively, you can edit the auth-type section of the main-config.xml file and set . • The number of quests which can log in to TeamCity is unlimited. • Guest login doesn't require any licenses.

See also:

• Authentication Settings • Licenses

Document generated by Confluence on Jun 16, 2008 13:43 Page 124 Including Third-Party Reports in the Build Results

This page last changed on May 07, 2008 by ivrina. Including Third-Party Reports in the Build Results

TeamCity can be extended to include information provided by third-party reporting tools.

If your reporting tool produces a report in HTML format, you can add a new tab to the build results page which will show the report. To do this specify the report as an artifact and modify the configuration to instruct the server to display the report whenever it is found in the artifact.

To enable including a report in a separate tab:

1. For the build configuration, that produces a report, add an archive or directory to the Artifact paths of the build runner. 2. Add the following line within the tag of the /config/main- config.xml file:

where:

• title is a unique title of the report tab • basePath is an archive or directory that contains the generated report, something like javadoc or report.zip • startPage is a relative path of the start page within the report archive or directory.

See also:

• Build Script Interaction with TeamCity

Document generated by Confluence on Jun 16, 2008 13:43 Page 125 Mapping External Links in Comments

This page last changed on Nov 07, 2007 by mio. Mapping External Links in Comments

TeamCity allows to map the issues in comments of the users' commits in the version control system using the search and replace pattern.

To configure mapping:

1. Navigate to the file TeamCity data directory/config/main-config.xml 2. Locate section , or create one under the tag, if it doesn't exist (you may refer to the main-config.dtd file for the XML structure definition) 3. Specify the search and replace patterns. For example, you can use the following pattern for enabling JIRA integration:

... ...

NOTE Search & replace patterns have java.util.regex.Pattern syntax.

Document generated by Confluence on Jun 16, 2008 13:43 Page 126 Using HTTPS to access TeamCity server

This page last changed on Nov 08, 2007 by chamilton. Using HTTPS to access TeamCity server

This document describes how to configure various TeamCity server clients to use HTTPS for communicating with the server. We assume that you have already configured HTTPS in your web server. See how to do this for Tomcat here: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html.

If your certificate is valid (i.e. it was signed by a well known Certificate Authority like Verisign), then TeamCity clients should work with HTTPS without any additional configuration. All you have to do is to use https:// links to the TeamCity server instead of http://.

If your certificate is not valid:

• To enable HTTPS connections from TeamCity Visual Studio plugin and Tray notifier, point your Internet Explorer to the TeamCity server using https:// URL and import the server certificate into the browser. After that Visual Studio plugin and Tray notifier should be able to connect by HTTPS. • To enable HTTPS connections from Java clients, save server certificate to a file, and then import it into the corresponding Java keystore using keytool program. By default, Java keystore is protected by password: changeit • For Build Agent import certificate, use the following command:

keytool -importcert -file -keystore /jre/lib/security/ cacerts

• For IntelliJ IDEA plugin:

keytool -importcert -file -keystore /jre/lib/ security/cacerts

• For Eclipse plugin:

keytool -importcert -file -keystore /jre/lib/ security/cacerts

Document generated by Confluence on Jun 16, 2008 13:43 Page 127 Enabling the Status Widget for Build Configurations

This page last changed on Mar 28, 2008 by ivrina.

Enabling the Status Widget for Build Configurations

By enabling the status widget, it is possible for any external web page to retrieve the latest build status of one or more build configurations.

In addition to enabling this option when creating or editing the general settings of the build configuration, you need to include the following snippets of code in the web page source:

• Add this code sample in the section (or alternatively, add the withCss=true parameter to externalStatus.html):

• Insert this code sample where you want to display the build configuration's status:

• If you prefer to use plain HTML instead of , omit the js=1 parameter • If you want to include default CSS styles without modifying the section, add the withCss=true parameter • To provide up-to-date status information on specific build configurations, use the following parameter in the URL as many times as needed:

&buildTypeId=

• It is also possible to show the status of all a project's build configurations by replacing "&buildTypeId=" with "&projectId=". You can select a combination of these parameters to display the needed projects and build configurations on your web page. • You can also download and customize the externalStatus.css file (e.g. you can disable some columns by using display: none; See comments in externalStatus.css). But in this case, you must not include the withCss=true parameter, but provide the CSS styles explicitly, preferably in the section, instead.

See also:

• UI Reference: Feed URL Generator

Document generated by Confluence on Jun 16, 2008 13:43 Page 128 Enterprise License Expiration

This page last changed on Dec 03, 2007 by yaegor. Enterprise License Expiration

When an Enterprise license expires (or the license key becomes corrupted), TeamCity reverts to working in Professional mode.

This means that certain features will be disabled or have limited functionality and that builds will not run unless a number of stipulations are met. (For details on TeamCity Professional's limitations please see Editions).

TeamCity preserves your Enterprise settings when downgrading to Professional. However, if you have to remove users or build configurations to work in Professional mode, it is recommended you make a backup of the TeamCity Data Directory to use when restoring Enterprise mode. Feature changes when reverting from Enterprise to Professional

Roles

• System and Project Administrators in Enterprise change into Administrators. (TeamCity actually checks to see if the EDIT_PROJECT permission is present in the user's account). • Project Developers and Agent Managers revert to Users. • Guest users, regardless of how they were configured in Enterprise mode, will only be able to view projects.

(See: Roles)

User Authentication

NT and LDAP Authentication will not work in Professional mode. If you were not already using TeamCity's default authentication scheme then up to 20 TeamCity users will need to have new accounts created for them using this scheme.

(See: Authentication Scheme | Authentication Settings) Restoring Enterprise Mode

After you enter a valid Enterprise license all limitations will be removed and:

• Enterprise user roles and permissions are preserved while running in Professional mode and are automatically restored • Users created while working in Professional mode will be assigned the "Default User" settings when switching to Enterprise.

If you made a backup of your TeamCity Data Directory because you had more than 20 build configurations or users, and you ran builds in Professional mode, you will want to back up your current TeamCity Data Directory to preserve your most up-to-date build information. Restore the original "Enterprise" backup before entering your Enterprise license, then manually copy the specific build folders from the more recent "Professional" backup.

See also:

• Concepts: Editions | Licensing Policy • UI Reference: Licenses • License Agreement: http://www.jetbrains.com/teamcity/buy/license.html

Document generated by Confluence on Jun 16, 2008 13:43 Page 129 Logs of Internal Events

This page last changed on May 26, 2008 by yaegor. Logging the Internal Events

TeamCity uses Log4J for internal logging of events. The following logging rules are used: Build agent logs

Build agent Log4J configuration file is /conf/teamcity-agent-log4j.xml Build agent logs are placed to /logs directory. General build agent log is named teamcity-agent.log When build agent is installed using Java Service Wrapper (as windows service), it logs its output and error output to /logs/wrapper.log .

To configure location of the logs, you have to alter value of teamcity_logs property (passed to JVM via - D option). To change Log4J configuration file location, you have to change value of log4j.configuration property.

Such changes should be made in:

/launcher/conf/wrapper.conf file if build agent is installed as service • /bin/agent.(sh|bat) if the agent is run from the command line TeamCity server logs

TeamCity server Log4J configuration file is /conf/teamcity-server-log4j.xml TeamCity server logs are placed to /logs directory and prefixed with teamcity- prefix. General TeamCity server log is named teamcity-server.log, there are also teamcity-activities.log and teamcity-vcs.log.

To configure location of the logs, you have to alter value of teamcity_logs property (passed to JVM via - D option). To change Log4J configuration file location, you have to change value of log4j.configuration property.

Such changes should be made:

• in files /bin/runAll.(bat|sh) if server is run from the command line (or in catalina.(bat|sh) • Using tomcat6w.exe, if TeamCity is installed as Windows service • If you used the WAR-distribution to install TeamCity, by default you should be able to find teamcity.log file in the /logs directory. You may add log4j.configuration property to specify Log4J configuration for TeamCity.

Example of server log configuration properties:

-Dlog4j.configuration=file:../conf/teamcity-server-log4j.xml -Dteamcity_logs=../logs/

Document generated by Confluence on Jun 16, 2008 13:43 Page 130 Managing Projects

This page last changed on Nov 23, 2007 by mio. Managing Projects

To create a new project:

1. On the Administration page, click the Create project link. 2. On the Create New Project page, specify the project name and optional description. 3. Click Create. An empty project is created. Tip To configure an existing project, select the desired project in the list, and click Edit. 4. Create build configurations (select build settings, configure VCS settings, and choose build runners) for the project. 5. Assigning Build Configurations to Specific Build Agents

Document generated by Confluence on Jun 16, 2008 13:43 Page 131 Assigning Build Configurations to Specific Build Agents

This page last changed on Feb 11, 2008 by chamilton. Assigning Build Configurations to Specific Build Agents

It is sometimes necessary to manage the Build Agents' workload more effectively. For example, if the time-consuming performance tests are run, the Build Agents with low hardware resources may slow down. As a result, more builds will enter the build queue, and the feedback loop can become longer than desired. To avoid such situation, you can:

1. Establish a run configuration policy for an agent, which defines the build configurations to run on this agent. 2. Define special agent requirements, to restrict the pool of agents, on which a build configuration can run the builds. These requirements are:

• Build Agent name. If the name of a build agent is made a requirement, the build configuration will run builds on this agent only. • Build Agent property. If a certain property, for example, a capability to run builds of a certain configuration, an operating system etc., is made a requirement, the build configuration will run builds on the agents that meet this requirement. Tip You can modify these parameters when setting up the project or build configuration, or any moment you need. The changes you make to the build configurations are applied on the fly.

Establishing a Run Configuration Policy

To establish a Build Agent's run configuration policy:

1. Click the Agents tab and select the desired build agent. 2. Click the Compatible Configurations tab. 3. Select Run selected configurations only and tick the desired build configurations names to run on the build agent.

Making Build Agent Name and Property a Build Configuration Requirement

To make a build configuration run the builds on a build agent with the specified name and properties:

1. Click the Administration tab and select the desired build configuration. 2. Click Agent Requirements (see Agent Requirements). 3. Click the Add requirement for a property link, type the agent.name property, set its condition to equals and specify the build agent's name. Note You can also use the condition contains, however, it may include more than one specific build agent (e.g. a build configuration with a requirement agent.name contains Agent10, will run on agents named Agent10, Agent10a, and Agent10b). 4. Click the Add requirement for a property link and add the required property, condition, and value. For example, if you have several Linux-only builds, you can add the os.name property and set the starts with condition and the linux value. Tip On the Agent Requirements page, click the Frequently used requirements link to quickly add the regularly used requirements.

Document generated by Confluence on Jun 16, 2008 13:43 Page 132 See also:

• Concepts: Build Agent | Agent Requirements | Build Queue | Run Configuration Policy • UI Reference: Administration

Document generated by Confluence on Jun 16, 2008 13:43 Page 133 Configuring Artifact Dependencies

This page last changed on Mar 14, 2008 by pavel.sher. Configuring Artifact Dependencies

A build configuration can be made dependent on the artifacts of builds of some other build configurations. That means that before the build, all artifacts, the build configuration is dependent on will be downloaded and placed in their configured target locations and then can be used by the build.

There are two ways to define artifact dependencies:

• Via web UI • Via Ant build.xml with using Ivy tasks or Ivy tool from the command line

Configuring Dependencies Using the Web UI

To add dependencies to a build configuration:

1. Open Edit build configuration page. 2. In the Build Configuration Steps, choose Artifact dependencies. 3. Click Add new dependency link. 4. In the Artifacts Dependencies page, specify the following settings: • Build configuration and build from which artifacts should be taken • Paths to artifacts as they are shown on server • Destination path on agent where to put downloaded artifacts.

Configuring Dependencies in Ant build.xml

This solution is more complicated but allows greater flexibility. For example, configuring dependencies in this way will allow you to start a personal build and verify that your build is still compatible with dependencies.

To configure dependencies in Ant build.xml:

1. Download Ivy.

TeamCity itself acts as an Ivy repository. You can read more about the Ivy dependency manager here: http://ant.apache.org/ivy/.

2. Add Ivy to the classpath of your build. 3. Create ivyconf.xml file that contains some meta information about TeamCity repository. This file should have the following content:

Document generated by Confluence on Jun 16, 2008 13:43 Page 134

4. Replace YOUR_TEAMCITY_HOST_NAME with the host name of your TeamCity server.

5. Place ivyconf.xml in the directory where your build.xml will be running.

6. In the same directory create ivy.xml file in which define which artifacts should be downloaded and where to put them, for example:

Where

• YOUR_ORGANIZATION should be replaced with the name of your organization. • YOUR_MODULE should be replaced with the name of your project or module where artifacts will be used. • BUILD_CONFIGURATION_ID should be replaced with id of the build configuration from where artifacts are downloaded. You can obtain this id from the links in your TeamCity server (you should take value of buildTypeId parameter). e.g. bt20 • BUILD_REVISION can be either build number or one of the following strings: ° latest.lastFinished ° latest.lastSuccessful ° latest.lastPinned • ARTIFACT_FILE_NAME_WITHOUT_EXTENSION file name or regular expression of the artifact without extension part. • ARTIFACT_FILE_NAME_EXTENSION extension part of the artifact file name.

7. Modify your build.xml file and add tasks for downloading artifacts, for example (applicable for Ant 1.6 and later):

Please note that among ivy commons-httpclient, commons-logging and commons-codec should be in classpath of Ivy tasks.

Since 2.1 artifacts repository is protected by basic authentication. For accessing artifacts you should provide credentials to the task. For example:

Document generated by Confluence on Jun 16, 2008 13:43 Page 135 where TEAMCITY_HOST is hostname or IP address of your TeamCity server (without port and servlet context). As USER_ID/PASSWORD you can use either username/password of a regular TeamCity user or system properties teamcity.auth.userId/teamcity.auth.password.

The properties teamcity.auth.userId/teamcity.auth.password store automatically generated build- unique values whose only intended use is artifacts downloading within the build script. The values are valid only during the time the build is running. Using the properties is preferable to using reall user credentials since it allows the server to track artifacts downloaded by your build. If the artifacts were downloaded by the build configuration artifact dependencies or using the supplied properties, the specific artifacts used by the build will be displayed on the build results page. In addition, the builds which were used to get the artifacts from will not be cleaned up by the clean-up process much like the pinned builds.

See also:

• Edit build configuration page • Artifacts Dependencies page • Build results Dependencies tab • http://incubator.apache.org/ivy/doc/ant.html (Ivy Ant tasks).

Document generated by Confluence on Jun 16, 2008 13:43 Page 136 Configuring Build Runners

This page last changed on May 20, 2008 by ivrina. Configuring Build Runners

This section contains detailed information regarding configuration issues and troubleshooting Build Runners.

The build runner pages in the UI Reference contain basic notes applicable to each field the interface.

• .NET Testing Frameworks Support • Additional Functionality in MSBuild Scripts • Ant_ • Maven2_ • NAnt_ • Sln2005_ • Sln2008_

See Also

• Concepts: Build Runner • UI Reference: Build Runners

Document generated by Confluence on Jun 16, 2008 13:43 Page 137 .NET Testing Frameworks Support

This page last changed on May 05, 2008 by ivrina. .NET Testing Frameworks Support

In order to support the real-time reporting test results, TeamCity should either run the tests using its own test runner or be able to interact with the testing frameworks so it receives notifications on test events. Custom TeamCity-aware test runners are used to implement the bundled support for the testing frameworks.

The following frameworks are supported:

• NUnit 2.2.x • NUnit 2.4.x (since TeamCity 3.1) • MSTest

This section covers:

• TeamCity 3.0 testing frameworks support • TeamCity 3.1 testing frameworks support TeamCity 3.0

TeamCity NUnit Test Launcher

TeamCity uses its own NUnit tests launcher that can be used from the any runner. The tests are run according to the passed parameters and if the process is run inside TeamCity build agent environment, the results are reported to the TeamCity agent.

The properties are available as both environment variables and system properties are available under any build process running on TeamCity, e.g. NAnt, MSBuild, Ant, SimpleRunner, etc. teamcity.dotnet.nunitlauncher1.1 - full launcher application name for .Net Framework 1.1, NUnit 2.2.8 teamcity.dotnet.nunitlauncher2.0 - full launcher application name for .Net Framework 2.0, NUnit 2.2.8 teamcity.dotnet.nunitlauncher2.0.vsts - full launcher application name for .Net Framework 2.0, VSTS tests

Starting from TeamCity 3.1.x these properties are considered obsolete.

Inside the build run by TeamCity the name of the NUnit launcher can be obtained through the system properties and environment variables.

The command line syntax is as follows:

%teamcity.dotnet.nunitlauncher% MyAssemblyToTest1 MyAssemblyToTest2

The launcher can be used in the build script to run the tests. e.g. here is an example for NAnt script (as of TeamCity 3.0):

Document generated by Confluence on Jun 16, 2008 13:43 Page 138 NAnt Runner

TeamCity provides custom task implementation. TeamCity automatically replaces the original task with its own task, so if your build script uses the nunit2 task, it will automatically work without any modifications to the build script.

MSBuild Runner

TeamCity provides custom NUnitTeamCity task and NUnit task that is compatible with NUnit task from MSBuild Community tasks project. The MSBuild NUnit/NUnitTeamCity tasks are a convenient way to run the tests for MSBuild and Solution 2005 builds. Example usage is (part of the MSBuild build script):

• Make sure to replace "." with "_", when using properties in MSBuild scripts. (i.e. use teamcity_dotnet_nunitlauncher_msbuild_task instead of teamcity.dotnet.nunitlauncher.msbuild.task) • TeamCity also provides a Solution 2005 Runner for Microsoft Visual Studio 2005 solution files. It allows you to use MSBuild-style wildcards for the assemblies to run unit tests on. TeamCity 3.1

NAnt Runner

Since TeamCity 3.1, the following options are supported for TeamCity task implementation:

Property name description teamcity.dotnet.nant.nunit2.failonfailureatendRun all tests and fails if at least one test has failed. teamcity.dotnet.nant.nunit2.platform Sets desired runtime execution mode for .NET 2.0 on x64 machines. Supported values are x86, x64 and ANY(default). teamcity.dotnet.nant.nunit2.version Specifies which version of the NUnit runner to use. Supported versions are: NUnit-2.2.10 (default), NUnit-2.2.9-VSTS and NUnit-2.4.6.

TeamCity 3.1 also supports the NAnt 0.86 runner and the NUnit 2.4 testing framework.

TeamCity NUnit test launcher will run tests in the .NET Framework, which is specified by NAnt target framework, i.e. on .NET Framework 1.1 or .NET Framework 2.0 runtime. TeamCity 3.1. also supports test categories for task.

Shown properties can be using task of NAnt or using TeamCity system properties under runner configuration.

MSBuild Runner

Since TeamCity 3.1, the NUnitTeamCity task supports extra attributes to the NUnitTeamCity task:

Property name description Platform Specifies the desired execution mode on a x64 machine. Supported values are: x86, x64 and ANY. IncludeCategory As used in the original task

Document generated by Confluence on Jun 16, 2008 13:43 Page 139 ExcludeCategory As used in the original task NUnitVersion Specifies which version of NUnit to run the tests. Supported values are: NUnit-2.2.10 (default), NUnit-2.2.9-VSTS, NUnit-2.4.6.

TeamCity NUnit Launcher

The property is available as both environment variables and system properties of the build system (NAnt, MSTest) teamcity.dotnet.nunitlauncher — full launcher application name

TeamCity 3.1 is backward compatible to TeamCity 3.0, thus it still defines the set of properties teamcity.dotnet.nunitlauncher, but now those properties are obsolete.

The launcher supports the following command line options:

${teamcity.dotnet.nunitlauncher} [<.NET Framework>] [] [/category-include:] [/ category-exclude:] [] where

• <.NET Framework> is the version of .NET Framework to run tests. Possible values are 1.1 or 2.0. • — platform to run tests. Possible values: x86, x64 and MSIL. For .NET Framework 1.1 it is only possible to use MSIL platform. • is the test framework to use. Possible values: NUnit-2.2.10, NUnit-2.2.9-VSTS and NUnit-2.4.6 • is the list of categories separated by ';'. • is the list of assemblies paths separated by ';' or space. NUnit-2.2.9-VSTS is a modified version of NUnit to run Microsoft Visual Studio Team System Tests (for Microsoft Visual Studio 2005)

See also:

• System Administrator's Reference: Predefined Agent-Specific Properties • UI Reference: Agent Details | Build Runners

Document generated by Confluence on Jun 16, 2008 13:43 Page 140 Additional Functionality in MSBuild Scripts

This page last changed on May 06, 2008 by ivrina. Additional Functionality in MSBuild Scripts

Be sure to replace "." with "_" when using properties in MSBuild scripts. That is you have to use teamcity_dotnet_nunitlauncher_msbuild_task instead of teamcity.dotnet.nunitlauncher.msbuild.task

NUnit and NUnitTeamCity tasks

TeamCity provides additional functionality with its own NUnit and NUnitTeamCity tasks for build runners that use MSBuild scripts.

In order for these tasks to work the teamcity_dotnet_nunitlauncher system property have to be accessible. Build Agents running windows should automatically detect these properties as environment variables. If you need to set them manually, see defining agent specific properties for more information.

The NUnit/NUnitTeamCity task uses the following syntax:

The NUnit/NUnitTeamCity task tests .NET Assemblies with NUnit. Add the following code to your target in MSBuild script to implement it:

This NUnit task is automatically included in MSBuild and Solution2005 and Solution2008 builds.

TeamCity uses its own version of NUnit task for running NUnit tests. TeamCity version is compatible with the MSBuild Community Task and will issue a warning, if TeamCity does not support an attribute listed in the build script. These warnings are only for your information and will not affect the building process.

Document generated by Confluence on Jun 16, 2008 13:43 Page 141 Ant_

This page last changed on Feb 19, 2008 by chamilton.

This page is under construction.

Ant

Basic information on setting up the Ant Build Runner can be found in the Ant section of the UI Reference. This section contains additional information related to the Ant Build Runner. Support for Running Parallel Tests

By using the tag in your Ant script it is possible to have the JUnit and TestNG tasks run in parallel. TeamCity supports this and should concurrently log the parallel processes correctly.

See also:

• UI Reference: Ant

Document generated by Confluence on Jun 16, 2008 13:43 Page 142 Maven2_

This page last changed on Feb 19, 2008 by chamilton. Maven2

Basic information on setting up the Maven2 Build Runner can be found in the Maven2 section of the UI Reference. This section contains troubleshooting information related to Maven2. Solving the issue with Surefire XML Reporter

Some users complained about incorrect number of tests reported (see http://www.jetbrains.net/jira/ browse/TW-586 and http://jira.codehaus.org/browse/SUREFIRE-122). This is caused by a bug in Surefire 2.2 used in Maven 2.0.4 by default. This bug was fixed in Surefire version 2.3.

To use the new plugin version locally for a single project, you need to modify the corresponding POM file. It must contain the following code fragment within the project/build/plugins element.

org.apache.maven.plugins maven-surefire-plugin 2.3 ...

See also:

• UI Reference: Maven2

Document generated by Confluence on Jun 16, 2008 13:43 Page 143 NAnt_

This page last changed on May 06, 2008 by ivrina. NAnt

Basic information on setting up the NAnt Build Runner can be found in the NAnt section of the UI Reference. This section contains information on working with the NAnt Runner. Setting the NAntHome Environment Variable

When selecting NAnt as the build runner, you need to specify the NAntHome environment variable on the agent machine with a path to the NAnt 0.85 distribution folder. This can be done by setting the environment variable on agent machine or by adding the env.NAntHome variable to the agent properties file or during the Properties and environment variables step when creating a build configuration. Please note that the variable name is case sensitive. MSBuild Task for NAnt

TeamCity NAnt runner includes a task called msbuild that allows NAnt to start MSBuild scripts. TeamCity msbuild task for NAnt has the same set of attributes as the NAntContrib package msbuild task. The MSBuild build processes started by NAnt will behave exactly as if they were launched by TeamCity MSBuild/SLN2005 build runner (i.e. NUnit and/or NUnitTeamCity MSBuild tasks will be added to build scripts and logs and error reports will be sent directly to the build server).

By default, NAnt msbuild task uses MSBuild 2.0 (from Microsoft .NET Framework 2.0), however you can use MSBuild 3.5 (from Microsoft .NET Framework 3.5) if you add the teamcity_dotnet_use_msbuild_v35 property with the value of true to your msbuild task in NAnt script. For example:

... ... ...

NUnit 2 Task for NAnt

To test all of the assemblies without halting on first failed test please use:

'failonfailureatend' attribute is not defined in the original NUnit2 task from NAnt. Note that this attribute will be ignored if the 'haltonfailure' attribute is set to 'true' for either the nuni2 element or the test element.

Document generated by Confluence on Jun 16, 2008 13:43 Page 144 See also:

• UI Reference: NAnt

Document generated by Confluence on Jun 16, 2008 13:43 Page 145 Sln2005_

This page last changed on Feb 28, 2008 by eugene petrenko. Solution 2005 Runner

.NET Testing Frameworks Support

Document generated by Confluence on Jun 16, 2008 13:43 Page 146 Sln2008_

This page last changed on Feb 28, 2008 by eugene petrenko. Solution 2008 Runner

.NET Testing Frameworks Support

Document generated by Confluence on Jun 16, 2008 13:43 Page 147 Configuring Build Triggers

This page last changed on Mar 24, 2008 by ivrina.

Configuring VCS Build Triggers Rules

VCS Build Triggers automatically start a new build each time TeamCity detects that updates have been checked into the Version Control System. By default, when this option is enabled, TeamCity scans all of the build configuration's VCS roots. TeamCity offers a wide range of wildcards and operators to exclude parts of the VCS roots or check ins performed by specific users from a VCS trigger. These rules should be entered in Build trigger rules text box.

The general syntax for a single rule is as follows:

+|-:[user=VCS_username;][root=VCS_path]:[Ant-like wildcard]

Please refer to Ant documentation for the description of Ant-like wildcards

Please note that only "*" and "**" patterns are supported. "?" is not supported.

When entering rules please note the following:

• To enter multiple rules, each rule should be entered on a single line separated by a line feed character. • The most specific rules are applied first, regardless of the order that the rules are listed in. • As soon as you enter a "+" operator, TeamCity will remove the default include all setting. To manually reset it enter "+:**". • If you don't enter an operator it will default to "+".

An example with three build triggering rules:

-:/src/help -:**.html -:user=techwriter;root=Internal SVN:/doc/*.xml -:lib/**

In the above example,

• the rule "-:/src/help" excludes a build being triggered when updated files are checked into the src/ help path of the VCS root. • the rule "-:**.html" excludes all .html files from trigger a build. • the rule "-:user=techwriter;root=Internal SVN:/doc/*.xml" excludes builds being triggered by .xml files checked in by user "techwriter" to the doc path of the VCS root named Internal SVN (as defined in the VCS Settings). • the rule "-:lib/**" prevents the build from triggering by updates to the "lib" directory of the agent. All files placed into the directory (by processing VCS root checkout rules) will not cause a build to be triggered.

See also:

• Concepts: Build Trigger • UI Reference: Build Triggering

Document generated by Confluence on Jun 16, 2008 13:43 Page 148 Configuring VCS Settings

This page last changed on May 23, 2008 by ivrina. Configuring VCS Settings

This section provides notes on configuring the following VCS Settings:

Error formatting macro: toc: java.lang.NullPointerException

Configuring VCS Roots

A VCS Root is a description (a number of connection settings) of a version control system where project sources are located.

VCS roots are configured on the Version Control Systems page of a build configuration.

Note to users upgrading from version 2.1.1 Starting with version 3.0, VCS roots are now specific to build configurations rather than projects. System time at the VCS server and the machines that check out the project sources (server or agents, depending on the value of the build configuration VCS checkout mode setting) must be synchronized. This requirement applies to CVS, Subversion, and ClearCase configurations, as well as to StarTeam if the audit is disabled or the server is older than 9.0.

Shared VCS Roots

By default, the same VCS root(s) can be used by all of the project's build configurations. They can also be used by different projects when VCS Roots Sharing is enabled on the New or Edit VCS Roots page. Sharing VCS roots saves the administrator's time and the hassle of creating and maintaining identical VCS roots in the repository.

If someone attempts to modify a VCS root that is shared, TeamCity will issue a warning that the changes to the VCS root could potentially affect more that one project. The user is then prompted to either save the changes and apply them to all the projects using the VCS root, or to make a copy of the VCS root for use by either a specific build configuration or project.

VCS Checkout Mode

The VCS Checkout mode is a configuration that sets how project sources reach an agent. Agents do not need any additional software for automatic checkout modes.

TeamCity has three different VCS checkout modes:

Checkout mode Description Automatically on server The TeamCity server will export the sources and pass them to an agent before each build. Since sources are exported rather than checked out, no administrative data is stored in the file system and version control operations (like check in or label or update) can not be preformed. Automatically on agent The build agent will check out the sources before the build. This checkout mode is supported only for CVS and Subversion. Agent-side checkout frees more server resources and provides the ability to access version control-specific directories (.svn, CVS) i.e. the build script can perform VCS operations (like check-ins into the version control) - in this

Document generated by Confluence on Jun 16, 2008 13:43 Page 149 case please ensure the build script uses necessary credentials for the check-in. Please note that "exclude" Checkout Rules cannot improve agent checkout performance because it checks out the entire included directory, then deletes the files that were excluded. Do not check out files automatically TeamCity will not check out any sources. The build script will contain the commands to check out the sources. Please note that this mode can cause TeamCity to inaccurately report changes.

VCS Checkout Rules

VCS Checkout Rules allow you to exclude paths and/or map paths (copy directories and all their contents) to a different location on the Build Agent during checkout.

To add a checkout rule click the edit checkout rules link on the build configuration's Version Control Settings page and a pop-up window will appear where you can enter the rule.

The general syntax of a single checkout rule is as follows:

+|- : VCSPath [=> AgentPath]

When entering rules please note the following:

• To enter multiple rules, each rule should be entered on a separate line. • For each file the most specific rule will apply if the file is included, regardless of what order the rules are listed in. • If you don't enter an operator it will default to +:

Rules can be used to perform the following operations:

Syntax Explanation +:.=>Path Checks out the root into Path directory -:PathName Excludes PathName (note: the path must be a directory and not a filename) +:VCSPath=>. Maps the VCSPath from the VCS to the Build Agent's default work directory VCSPath=>NewAgentPath Maps the VCSPath from the VCS to the NewAgentPath directory on the Build Agent +:VCSPath Maps the VCSPath from the VCS to the same-named directory (VCSPath) on the Build Agent

An example with three VCS checkout rules:

-:src/help +:src=>production/sources +:src/samples=>./samples

In the above example, the first rule excludes the src/help directory and its contents from checkout. The third rule is more specific than the second rule and maps the scr/samples path to the samples path in the Build Agent's default work directory. The second rule maps the contents of the scr path to the production/sources on the build agent, except src/help which was excluded by the first rule and scr/ samples which was mapped to a different location by the third rule.

Exclude checkout rules will only speed up server-side checkouts. Agent-side checkouts emulate the exclude checkout rules by checking out all the root directories mentioned as include rules and deleting the excluded directories. So, exclude checkout rules should generally be avoided for the agent-side checkout.

Document generated by Confluence on Jun 16, 2008 13:43 Page 150 VCS Labeling Support

TeamCity can optionally add a label into the version control system for the sources used for a particular build. This is useful if you need to collect all of the sources for a specific build in order to recreate it. You can choose to apply the VCS label for all builds or only for successful ones. You can also manually invoke VCS labeling action for a finished build: Check "Label this build sources" in the "VCS revisions and labels" section of the Changes tab of the build results.

The labeling process takes place after the build finish and doesn't affect the build status. If the label fails it will not change the build's status.

VCS labeling is supported for ClearCase, CVS, Perforce, StarTeam and Subversion.

• Make sure the credentials you specify allow write access to the sources repository. • Perforce roots require specification of Perforce client (not TeamCity mapping) for labeling to work. "Moving" labels (label with the same name for different builds e.g. "SNAPSHOT") are currently supported only for CVS

Subversion

Subversion VCS roots need additional configuration for VCS labeling to work. The labeling rules need to be specified to define the SVN repository structure.

Labeling rules are specified as newline-delimited rules each of uses the following format:

TrunkOrBranchRepositoryPath => tagDirectoryRepositoryPath

The repository paths can be relative and absolute (starting from "/"). Absolute paths are resolved from the SVN repository root, relative paths are resolved from the VCS root.

When creating a label, the sources residing under TrunkOrBranchRepositoryPath will be put into the tagDirectoryRepositoryPath/ directory, where is the name of the label as defined by the labeling pattern of the build configuration. If no sources match the TrunkOrBranchRepositoryPath, then no label will be created. The path tagDirectoryRepositoryPath should already exist in the repository. If tagDirectoryRepositoryPath directory already contains subdirectory with the current label name, the labeling process will fail, and the old tag directory won't be deleted or affected.

For example, there is a VCS root with the URL svn://address/root/project where svn://address/root is the repository root, and the repository has the structure:

-project --trunk --branch1 --branch2 --tags

In this case the labeling rules should be: project/trunk=>project/tags project/branch1=>project/tags project/branch2=>project/tags

See also:

• Concepts: Version Control System | VCS Root • UI Reference: Version Control Systems Configuration

Document generated by Confluence on Jun 16, 2008 13:43 Page 151 Creating and Editing Build Configurations

This page last changed on Dec 05, 2007 by mio. Creating and Editing Build Configurations

To create new build configuration for a project:

1. On the Administration page, locate the desired project in the list. 2. Click the Create build configuration link. 3. Specify the General Settings. Refer to Create or Edit Build Configuration for detailed description of the options. 4. Click the VCS settings button 5. Create/edit VCS roots and specify VCS-specific settings. See Configuring VCS Settings and Version Control Systems Configuration for additional information on CVS roots and a detailed description of the VCS configuration options, respectively. 6. Click the Build Runner button. 7. On the Choose Build Runner page, select the desired build runner from the drop-down list, and define its settings. Refer to the 3.Build Runners topic for detailed description of the runner-specific options. 8. Click Save.

To edit an existing build configuration:

1. On the Administration page, locate the desired build configuration. 2. Click the Edit link. The build configuration opens in the General Settings section of Create or Edit Build Configuration page. 3. In the General Settings page, update options as required. 4. Perform the tasks suggested in the Build Configuration Steps list, and save changes: • configure VCS settings • configure build runner • specify build triggering • configure artifact dependencies • define environment variables and properties. • specify requirements that should be met for the agents to be able to run the builds.

See also:

• System Administrator's Reference: Configuring Artifacts Dependencies| System Properties of a Build Configuration | Configuring VCS Settings • UI Reference: Administration

Document generated by Confluence on Jun 16, 2008 13:43 Page 152 Notifier Templates Configuration

This page last changed on May 07, 2008 by ivrina. Notifier Templates Configuration

In this section you can find reference information on the location and syntax of notifier templates, connection with the build events, patterns used to represent important information, and examples:

• Notifier Templates ° Location ° Syntax • Substitution Patterns ° "build_started" event patterns ° "build_successful", "build_failed" and "build_failing" events patterns ° "responsible_changed" event patterns • Examples ° Email notifier ° Jabber notifier

Notifier Templates

Location

Notifier templates reside in the notifier configuration file:

• Email notifier: /config/email-config.xml • Jabber: /config/jabber-config.xml • System Tray Notifier: /config/win32-config.xml

The server automatically reloads a template from the corresponding file, if it detects that this file is changed on disk.

Syntax notes

Syntax of the notifier configuration files is described in the respective *.dtd files. Notifier configuration file contains two sections:

— notifier-specific templates with notification messages • — the list of events to be notified about, with the references to the associated templates

All templates are placed into the section, for example:

• Email templates must have and sub-elements.

Document generated by Confluence on Jun 16, 2008 13:43 Page 153 • Jabber templates text should be placed directly into the