TeamCity is a Continuous Integration and build management server from JetBrains. With it you can set up automatic builds, tests and deployment. Getting it up and running took a lot of reading on my end, so I would like to share a detailed step by step guide on how I got it done on my Windows 8.1 Pro computer with MS SQL Server 2014.
Start by going to Jetbrains downloads and get the latest version which at the time being is TeamCity 8.1.3.
After the download completes run the .exe file, click next and accept license agreement
The Data Directory is where the TeamCity server stores configuration settings, build results and current operation files. It can become quite big, so TeamCity recommends to place it on a non-system disk.
NOTE: Be sure to place the Data Directory path in it’s own folder if you install it in the same place as the TeamCity program files, it didn’t work if I installed everything in the same folder level.
After the installer has run, choose a port. The default is 80 which you might need to change if it’s already occupied, as it is on my machine. I’m going to put mine at port 81, so my address to the TeamCity UI will be localhost/81
Following the setup wizard further you can either run the TeamCity Service Account as SYSTEM or an user account. I picked user account because I am an Administrator on my computer and I tried with the SYSTEM installation multiple times but it refused to work. (Feel free to try either one, your system might be different from mine).
NOTE: From here on out to run TeamCity, simply start the two services in the Task Manager.
As TeamCity recommends you should store the data in an external database and only use their internal one if it’s for evaluation purposes, so select MS SQL Server from the drop down list. Make sure to check that the directory TeamCity is looking for is correct. (If you didn’t change the path of the TeamCity Data Directory during the installation it might be located in a hidden folder such as C:\ProgramData\JetBrains\TeamCity\lib\jdbc. Just copy the file path above and paste it in your file explorer to validate its existence.)
Inside the blue box it might tell you that the MS SQL Server JDBC driver wasn’t found. Go to Microsoft Download Center and get the latest driver. (In my case it’s 4.0)
Go back to the TeamCity UI configuration and type in the database name (TeamCity_CS_AS) and choose authentication method from the drop down list. (My MS SQL Server uses windows authentication, so I will choose this)
You might run into the error “The TCP/IP connection to the host localhost, port 1433 has failed. Error: “Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.”
(UPDATE: The above picture is from the 8.1.4 build)
To fix this, I opened up my Sql Server Configuration Manager and clicked the SQL Server Network Configuration -> Protocols for MSSQLSERVER in the list to the right and enabled the TCP/IP
It will notify you to restart the service, so go and restart all the running services in SQL Server Services (again in the list to the right)
To fix this I found and followed the 64bit OS instructions on Mike O’Brien’s blog post:
- Copy the \auth\x64\sqljdbc_auth.dll (Note the x64 in the path) from the Microsoft JDBC driver folder you downloaded earlier into your C:\Windows\System32 folder (Or some location in the system path).
- Copy the contents of the TeamCity jre folder (my path: C:\Program Files (x86)\JetBrains\TeamCity\jre) into a folder called x86 (my path C:\Program Files (x86)\JetBrains\TeamCity\jre\x86) as a backup.
NOTE: You may get a “Folder In Use” prompt when you try to move the lib folder: just stop both the TeamCity services and (if any) java services and try again.
- Download the 64 bit Windows tar.gz version (Not the installer) of the jre here and extract it to a folder.
Depending on your compression tool you may have to uncompress and then extract the .tar archive in two separate steps. (with 7-zip you can just navigate into the files until you find the jre folder and extract that. My folder is called jre1.7.0_65)
- Copy the files from the jre folder that you downloaded and extracted into your TeamCity jre folder (my path: C:\Program Files (x86)\JetBrains\TeamCity\jre).
- Finally restart TeamCity and you should be golden.
This concludes the installation and first start configuration and I hope this post has helped someone out there. =)