/teamcity-azure-template

ARM template to deploy TeamCity on Azure

Primary LanguagePowerShell

TeamCity Azure Resource Manager Template

official project

The template allows deploying a TeamCity server and agent in Azure cloud. It creates a MySQL database, a virtual machine with CoreOS and starts TeamCity in a docker container.

During deployment will be created TeamCity server deployment with auto-retrieval of SSL certificate for domain name from the Let's Encrypt and nginx reverse proxy.

Deploy to Azure

Note: You need to deploy it into a dedicated resource group. Deployment will take around 10 minutes, use teamcityUrl template output value to access the TeamCity web UI.

Parameters

TeamCity Version

Allows specifying the required version of TeamCity for deployment.

Installation Size

List of pre-configured installation types:

Installation Size Typical Usage VM Size VM Data Disk Database
Small 3 users, 100 builds/day Standard_A2_v2 32 GB HDD Basic / 50 DTU / 50 GB
Medium 5 users, 300 builds/day Standard_F2s 64 GB SSD Basic / 100 DTU / 50 GB
Large 20 users, 1000 builds/day Standard_F4s 128 GB SSD Standard / 100 DTU / 125 GB

Note: Pricing for Azure virtual machines and MySQL database.

VM Admin Username

Allows specifying username to login to a virtual machine where TeamCity is running.

SSH Key Data

Allows specifying a publish ssh key for the user used to connect to virtial machine with TeamCity.

Database Password

Allows specifying password for the MySQL database.

Configuration

After deployment you will be able to connect to the teamcity virtual machine via SSH. In CoreOS TeamCity works as the following systemd service:

  • teamcity-server.service - launches TeamCity server.
  • teamcity-agent.service - launches TeamCity agent.
  • teamcity-update.service - check for TeamCity version updates.
  • nginx.service - provides reverse proxy for TeamCity server.
  • letsencrypt.service - executes auto SSL certificate retrieval for domain name.

To diagnose problems you could use the following commands:

  • sudo systemctl (start|stop|status|restart) <serviceName> - to manage service operation state.
  • sudo journalctl -u <serviceName> - to view history of service log.
  • sudo journalctl -f -u <serviceName> - to execute tail view of service log.

Installed Plugins

The template installs the following Azure integrations in TeamCity:

TeamCity Update

During deployment, a teamcity virtual machine will be tagged with the teamcity-version tag. To change the TeamCity version, you need to update the tag value and restart the teamcity-server.service and teamcity-agent.service systemd services or the virtual machine.

Note: in case of TeamCity data upgrade to access server log connect to the vm and execute the following command to view required authentication token: sudo journalctl -f -u teamcity-server

Feedback

Please feel free to send a PR or file an issue in the TeamCity issue tracker.