{"id":15135183,"url":"https://github.com/jetbrains/teamcity-google-template","last_synced_at":"2025-10-19T15:30:49.982Z","repository":{"id":33896973,"uuid":"123310684","full_name":"JetBrains/teamcity-google-template","owner":"JetBrains","description":"Google Cloud DM template to deploy TeamCity in GCP","archived":false,"fork":false,"pushed_at":"2024-02-07T18:27:27.000Z","size":76,"stargazers_count":19,"open_issues_count":7,"forks_count":29,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-30T02:02:17.569Z","etag":null,"topics":["deployment-manager","gcp","google-cloud","teamcity","template"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JetBrains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-28T16:21:23.000Z","updated_at":"2023-08-01T01:49:29.000Z","dependencies_parsed_at":"2024-02-07T19:40:21.278Z","dependency_job_id":"1aa85acf-2167-484c-b5c4-41bda5b9f502","html_url":"https://github.com/JetBrains/teamcity-google-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fteamcity-google-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fteamcity-google-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fteamcity-google-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fteamcity-google-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JetBrains","download_url":"https://codeload.github.com/JetBrains/teamcity-google-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237152977,"owners_count":19263817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment-manager","gcp","google-cloud","teamcity","template"],"created_at":"2024-09-26T05:44:02.735Z","updated_at":"2025-10-19T15:30:49.681Z","avatar_url":"https://github.com/JetBrains.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![obsolete JetBrains project](https://jb.gg/badges/obsolete-flat-square.svg)](https://github.com/JetBrains#jetbrains-on-github)\n\n# TeamCity Google Cloud Deployment Manager template \n\n**NOTE**: This is for illustrative purposes only and is not intended to be used to create a production-ready deployment of TeamCity.\n\nAllows creating a TeamCity deployment in Google Cloud by using the [gcloud tool](https://cloud.google.com/sdk/gcloud/) locally or in the [Google Cloud console](https://console.cloud.google.com/).\n\nThe template allows deploying a TeamCity [server](https://hub.docker.com/r/jetbrains/teamcity-server/) and [agent](https://hub.docker.com/r/jetbrains/teamcity-agent/) in Google Cloud Platform. It creates a MySQL database, a Google Compute Engine (GCE) instance with Flatcar Container Linux and starts TeamCity in a Docker container.\n\n## Pre-requisites\n\n### Service account\n\nPlease use the [IAM console](https://console.cloud.google.com/iam-admin/iam/project) to ensure that the [Deployment Manager service account](https://cloud.google.com/deployment-manager/docs/access-control#access_control_for_deployment_manager) `[project_number]@cloudservices.gserviceaccount.com` has the `Project Owner` role.\n\nTo do it, use the following command:\n\n```sh\n\u003e gcloud projects add-iam-policy-binding $(gcloud config get-value project) \\\n  --member serviceAccount:$(gcloud projects describe $(gcloud config get-value project) \\\n  --format=\"value(projectNumber)\")@cloudservices.gserviceaccount.com --role roles/owner\n```\n\n### Google Cloud APIs\n\nEnsure that you have enabled the following Google Cloud APIs in your project:\n* [Cloud Deployment Manager V2 API](https://console.cloud.google.com/apis/api/deploymentmanager.googleapis.com/overview)\n* [Google Cloud Resource Manager API](https://console.cloud.google.com/apis/api/cloudresourcemanager.googleapis.com/overview)\n* [Google Identity and Access Management (IAM) API](https://console.cloud.google.com/apis/api/iam.googleapis.com/overview)\n* [Cloud SQL Administration API](https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview)\n\nTo do it, use the following command:\n\n```sh\n\u003e gcloud services enable deploymentmanager.googleapis.com sqladmin.googleapis.com iam.googleapis.com \\\n  cloudresourcemanager.googleapis.com runtimeconfig.googleapis.com compute.googleapis.com\n```\n\n### Flatcar Container Linux Image\n\nThe Flatcar Container Linux image is not published to Google Cloud, so in order to use it you will have to publish it to your project. Follow the [official guide](https://docs.flatcar-linux.org/os/booting-on-google-compute-engine/#uploading-an-image).\n\n## Deployment\n\n### Quick Start \n\nThe easiest and **not secure** way to create test TeamCity deployment is to execute the following command:\n\n```sh\n\u003e gcloud deployment-manager deployments create \u003cdeploymentName\u003e \\\n  --template https://raw.githubusercontent.com/JetBrains/teamcity-google-template/master/teamcity.jinja \\\n  --properties zone:\u003czone\u003e\n```\n\nWhere `\u003cdeploymentName\u003e` should be unique name for deployment, e.g. \"teamcity\" and `\u003czone\u003e` is set to one of the [zones](https://cloud.google.com/compute/docs/regions-zones/). To list available zones execute the following command:\n\n```sh\n\u003e gcloud compute zones list\n```\n\n**Note**: Deployment will take several minutes, on completion you will be able to navigate to the `teamcityUrl` output value to see the TeamCity web UI.\n\n### Secure Deployment\n\nTo create a production ready TeamCity deployment you need to have a domain name from any domain registrar and be able to configure `A`/`CNAME` records for this domain (if you don't have any you could use [Google Cloud DNS](https://cloud.google.com/dns/docs/quickstart)). Then proceed with the following steps:\n\n1. Create [external IP](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address) and configure `A` record for your domain pointing to that IP. Wait until `nslookup \u003cdomainName\u003e` command on your computer will be resolved into target IP address. **Note**: it may take up to 48 hours, but normally takes up to 1 hour.\n2. Create a new TeamCity deployment:\n\n```sh\n\u003e gcloud deployment-manager deployments create \u003cdeploymentName\u003e \\\n  --template https://raw.githubusercontent.com/JetBrains/teamcity-google-template/master/teamcity.jinja \\\n  --properties zone:\u003czone\u003e,ipAddress:\u003cipAddress\u003e,domainName:\u003cdomainName\u003e,domainOwnerEmail:\u003cdomainOwnerEmail\u003e\n```\n\nWhere `\u003cdeploymentName\u003e` should be unique name for deployment, e.g. \"teamcity\", `\u003czone\u003e` is set to one of the [zones](https://cloud.google.com/compute/docs/regions-zones/), `\u003cipAddress\u003e` is set to the external IP address, `\u003cdomainName\u003e` is set to your domain name and optional `\u003cdomainOwnerEmail\u003e` is set to your e-mail to be notified in case of problems with SSL certificate retrieval.\n\nDuring deployment will be created TeamCity server deployment with [auto-retrieval of SSL certificates](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) from the [Let's Encrypt](https://letsencrypt.org/) and [nginx reverse proxy](https://github.com/jwilder/nginx-proxy).\n\n**Note**: Deployment will take several minutes, on completion you will be able to navigate to the `teamcityUrl` output value to see the TeamCity web UI.\n\n### Configuration Properties\n\nIt is possible to specify the following list of comma-separated `--properties` list for your deployment:\n\n* `zone` - the [zone](https://cloud.google.com/compute/docs/regions-zones/) in which this deployment will run.\n* `version` - the [TeamCity version](https://www.jetbrains.com/teamcity/download/) to be deployed. The properties are parsed as YAML values, so if you are specifying a major release version, put escaped single quotes around the value, e.g. `\\'2019.1\\'`.\n* `installationSize` - the size of the installation: small/medium/large.\n* `serviceAccount` - the e-mail of the service account specified for the TeamCity GCE instance.\n* `createStorageBucket` - allows creating a storage bucket to store build artifacts.\n* `ipAddress` - the preliminary created in the same region external IP address for TeamCity server.\n* `domainName` - the [verified domain name](https://cloud.google.com/compute/docs/instances/create-ptr-record#domain_ownership) for TeamCity server which will be used to retrieve SSL certificate.\n* `domainOwnerEmail` - the e-mail address of domain owner used to notify about SSL certificate renewal for domain name.\n* `network` - the network name in the [same region](https://cloud.google.com/compute/docs/regions-zones/) which will be used by the TeamCity GCE instance.\n* `subnetwork` - the subnetwork name in the same region which will be used by the TeamCity GCE instance.\n\n#### Installation Size\n\nThe list of pre-configured installation types:\n\n| Installation Size | Typical Usage             | vCPU | RAM  | VM Data Disk | Database         |\n| ----------------- | ------------------------- | ---- | ---- | ------------ | ---------------- |\n| small             | 3 users, 100 builds/day   | 1    | 3 GB | 30 GB HDD    | db-n1-standard-1 |\n| medium            | 5 users, 300 builds/day   | 2    | 4 GB | 50 GB SSD    | db-n1-standard-1 |\n| large             | 20 users, 1000 builds/day | 4    | 8 GB | 100 GB SSD   | db-n1-standard-2 |\n\n**Note**: See pricing for [Google Compute Engine](https://cloud.google.com/compute/pricing#custommachinetypepricing) and [MySQL database](https://cloud.google.com/sql/docs/mysql/pricing).\n\n## TeamCity Update\n\nTo change the TeamCity version, start the deployment script with the required version number and then execute the [Reset](https://cloud.google.com/compute/docs/instances/restarting-an-instance) action on the TeamCity GCE instance:\n \n```sh\n\u003e gcloud deployment-manager deployments update teamcity \\\n  --template https://raw.githubusercontent.com/JetBrains/teamcity-google-template/master/teamcity.jinja \\\n  --properties zone:\u003czone\u003e,version:\u003cversion\u003e\n```\n\n**Note**: The `zone` parameter cannot be changed during the deployment update.\n\n## Under the Hood\n\nDuring deployment, the template allocates the following resource:\n* Service account with `Project Viewer`, `Cloud SQL Client`, `Compute Instance Admin`, `Storage Object Admin` and `Service Account Token Creator` roles.\n* Network, firewall rules, and static IP address.\n* MySQL database and user.\n* GCE instance with a data disk powered by Flatcar Container Linux and the assigned service account.\n\n### GCE Instance\n\nAfter deployment you will be able to connect to the GCE instance via SSH. In CoreOS TeamCity works as the following systemd service:\n\n* `teamcity-server.service` - launches TeamCity server.\n* `teamcity-agent.service` - launches TeamCity agent.\n* `nginx.service` - provides reverse proxy for TeamCity server when `domainName` is set.\n* `letsencrypt.service` - executes auto SSL certificate retrieval for specified `domainName`.\n\nTo diagnose problems you could use the following commands:\n\n* `sudo systemctl (start|stop|status|restart) \u003cserviceName\u003e` - to manage service operation state.\n* `sudo journalctl -u \u003cserviceName\u003e` - to view history of service log.\n* `sudo journalctl -f -u \u003cserviceName\u003e` - to execute tail view of service log.\n\n### Installed Plugins\n\nThe template installs the following Google Cloud Platform integrations in TeamCity:\n\n* [Google Cloud Agents](https://plugins.jetbrains.com/plugin/9704-google-cloud-agents) - allows scaling the pool of TeamCity build agents by leveraging GCE.\n* [Google Artifacts Storage](https://plugins.jetbrains.com/plugin/9634-google-artifact-storage) - allows storing build artifacts in Google Storage Blobs.\n\n## Common Problems\n\n### \"Subnetwork should be specified for custom subnetmode network\" error while deployment\n\nIt happens when subnetwork was not specified or does not exist in the specified zone.\n\n### Could not connect to the TeamCity server with custom network\n\nEnsure that you have configured firewall rules to access TeamCity server on HTTP/HTTPS port.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fteamcity-google-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetbrains%2Fteamcity-google-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fteamcity-google-template/lists"}