Git Product home page Git Product logo

teamcity-google-template's Introduction

TeamCity Google Cloud Deployment Manager template

JetBrains incubator project

Allows creating a TeamCity deployment in Google Cloud by using the gcloud tool locally or in the Google Cloud console.

The template allows deploying a TeamCity server and agent in Google Cloud Platform. It creates a MySQL database, a Google Compute Engine (GCE) instance with CoreOS and starts TeamCity in a Docker container.

Pre-requisites

Service account

Please use the IAM console to ensure that the Deployment Manager service account [project_number]@cloudservices.gserviceaccount.com has the Project Owner role.

To do it, use the following command:

> gcloud projects add-iam-policy-binding $(gcloud config get-value project) --member serviceAccount:$(gcloud projects describe $(gcloud config get-value project) --format="value(projectNumber)")@cloudservices.gserviceaccount.com --role roles/owner

Google Cloud APIs

Ensure that you have enabled the following Google Cloud APIs in your project:

To do it, use the following command:

> gcloud services enable deploymentmanager.googleapis.com sqladmin.googleapis.com iam.googleapis.com cloudresourcemanager.googleapis.com runtimeconfig.googleapis.com

Deployment

Deploy TeamCity as a template by specifying the following properties:

> gcloud deployment-manager deployments create teamcity --template https://raw.githubusercontent.com/JetBrains/teamcity-google-template/master/teamcity.jinja --properties zone:<zone>

To list available zones execute the following command:

> gcloud compute zones list

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.

Properties

It is possible to specify the following properties for your deployment:

  • zone - the zone in which this deployment will run.
  • version - the TeamCity version to be deployed.
  • installationSize - the size of the installation: small/medium/large.
  • serviceAccount - the e-mail of the service account specified for the TeamCity GCE instance.
  • createStorageBucket - allows creating a storage bucket to store build artifacts.
  • network - the network name in the same region which will be used by the TeamCity GCE instance.
  • subnetwork - the subnetwork name in the same region which will be used by the TeamCity GCE instance.

Installation Size

The list of pre-configured installation types:

Installation Size Typical Usage vCPU RAM VM Data Disk Database
small 3 users, 100 builds/day 1 3 GB 30 GB HDD db-n1-standard-1
medium 5 users, 300 builds/day 2 4 GB 50 GB SSD db-n1-standard-1
large 20 users, 1000 builds/day 4 8 GB 100 GB SSD db-n1-standard-2

Note: See pricing for Google Compute Engine and MySQL database.

Further Steps

Note: TeamCity server exposes an HTTP endpoint, so make sure to enable the HTTPS endpoint for the GCE instance for production usage.

TeamCity Update

To change the TeamCity version, start the deployment script with the required version number and then execute the Reset action on the TeamCity virtual machine:

> gcloud deployment-manager deployments update teamcity --template https://raw.githubusercontent.com/JetBrains/teamcity-google-template/master/teamcity.jinja --properties zone:<zone>,version:2017.2.2

Note: The zone parameter cannot be changed during the deployment update.

Under the Hood

During deployment, the template allocates the following resource:

  • Service account with Project Viewer, Cloud SQL Client, Compute Instance Admin, Storage Object Admin and Service Account Token Creator roles.
  • Network, firewall rules, and static IP address.
  • MySQL database and user.
  • GCE instance with a data disk powered by CoreOS and the assigned service account.

GCE Instance

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

  • teamcity-server.service - launches TeamCity server.
  • teamcity-agent.service - launches TeamCity agent.

Installed Plugins

The template installs the following Google Cloud Platform integrations in TeamCity:

Common Problems

"Subnetwork should be specified for custom subnetmode network" error while deployment

It happens when subnetwork was not specified or does not exist in the specified zone.

Could not connect to the TeamCity server with custom network

Ensure that you have configured firewall rules to access TeamCity server on HTTP/HTTPS port.

teamcity-google-template's People

Contributors

dtretyakov avatar monsendag avatar julia-alexandrova avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.