Installation
Installation and Configuration
In this section:
Downloading TeamCity
TeamCity installation package is available at http://www.jetbrains.com/teamcity/download/index.html
Download one of the three available installation packages:
Target | Download | Note |
---|---|---|
Windows | TeamCity<version number>.exe | Executable Windows installer with bundled Tomcat and Java 1.5 JRE |
Linux, MacOS X | TeamCity<version number>.tar.gz | Package bundled with Tomcat servlet container for Linux, MacOS X or manual installation |
J2EE container | TeamCity<version number>.war | Package for installation into an existing J2EE container |
Installing TeamCity server
Having obtained the TeamCity installation package, proceed with installing the build server for:
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 TeamCity web server and one build agent that can be run as Windows services.
Installing TeamCity bundled with Tomcat servlet container
Unpack TeamCity<version number>.tar.gz archive (for example, using tar xfz TeamCity<version number>.tar.gz
command).
Start TeamCity server:
Go to TeamCity/bin directory
Launch the following command:
sh runAll.sh start
command for Linux and MacOS XrunAll.bat for Windows.
As a result, TeamCity runs on http://localhost:8111/ and has one registered build agent that runs on the same computer.
Stop TeamCity server and agent:
Launch
sh runAll.sh stop
command on Linux and MacOS XPress Ctrl+C in the runAll.bat console for Windows.
Installing TeamCity into existing J2EE container
Copy the downloaded TeamCity<version number>.war file into the web applications directory of your J2EE container under
teamCity.war
name.Restart the server or deploy the application via servlet container administration interface and access http://server/teamCity/.
Installing and running additional Build Agents
Before you can start customizing projects and creating build configurations, you need to configure Basic Concepts.
To install a build agent, follow these general steps:
Open Agents tab
Click Install Build Agents link
In the Install Build Agents dialog, choose one of the available installation options:
Enable the agent, if it connects to the server for the first time. To do that, open Agents page, select the desired agent in the list, and click Enable agent link.
Installing Build Agents via Java Web Start
Make sure JDK 1.5+ is installed on the computer.
On the agent computer, set up
JAVA_HOME
environment variable to point to JDK 1.5+ installation directory.Navigate to the Agents page in TeamCity web UI.
Click the "Install Build Agents" link and then click "Via Java Web Start".
Follow the instructions.
Installing Build Agents via MS Windows installer
Just follow the installation instructions to install additional build agents.
Installing Build Agents via zip file
Unzip the downloaded file into the desired directory.
Make sure that you have a JDK or JRE installed (You will need JDK (not JRE) for some build runners like IPR runner, Inspections, Duplicates). Please ensure there are JRE_HOME or JAVA_HOME environment variables set (pointing to the installed JRE or JDK directory respectively) for the shell in which agent will be started.
Navigate to the
<installation path>\conf
directory, locate the file calledbuildAgent.dist.properties
and rename it tobuildAgent.properties
.Edit the
buildAgent.properties
file and change the desired properties of the installed build agent:serverUrl - URL of the TeamCity server.
name - name of the build agent that will be visible in the web UI.
ownPort - port number that agent use to accept connections from server. Please make sure there is no firewall blocking incoming connections to the port.
ownAddress - the IP address of the computer running build agent. Required only if automatic detection fails.
Under Linux, you may need to set execute permission for bin/agent.sh shell script.
Starting the Build Agent
To start the agent manually, run the following script:
for Windows: <installation path>\bin\agent.bat
for Linux and MacOS X: <installation path>\bin\agent.sh
Installing and running Build Agent as a Windows service
On Windows, you may want to use build agent Windows service to allow the build agent to run without any user logged on.
To install the service:
Make sure there is no TeamCity Build Agent Service <build number> or agentd service already installed.
Run the
<agent>/bin/service.install.bat
file.
To start the service:
Run
<agent>/bin/service.start.bat
To stop the service:
Run
<agent>/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 <agent>\launcher\conf\wrapper.conf
Configuring TeamCity server
Configuring TeamCity data directory
By default, TeamCity data directory, is $HOME/.BuildServer
. Alternatively, you can define this directory in one of the following ways:
as a Tomcat system property
teamcity.data.path
in the
TEAMCITY_DATA_PATH
environment variable
Setting up MySQL database
Run TeamCity with the default settings to create TeamCity data directory.
Shutdown TeamCity server.
Download MySQL JDBC driver from: http://dev.mysql.com/downloads/connector/j/
Put MySQL connector jar to the
WEB-INF/lib
of TeamCity web applicationCreate empty database for TeamCity in MySQL and grant permissions to modify this database to a user from which TeamCity will work with this database. Consult Configuring UTF8 Character Set for MySQL document for more details on how to create database with unicode support.
In the TeamCity data directory rename
database.mysql.properties
file todatabase.properties
and specify the required settings in this file:connectionUrl=jdbc:mysql://<host>/<database name>
connectionProperties.user=<user>
connectionProperties.password=<password>
Start server.
Edit server configuration