TeamCity is one of the most prominent tools used by DevOps professionals to perform continuous integration and delivery, effectively. It plays an important role when it comes to Mobile-level DevOps implementation. In this article, we will see how to create a TeamCity Project.
This article is an excerpt from the book, Mobile DevOps, written by Rohin Tak and Jhalak Modi.
Once the installation is done, the TeamCity web user interface will open in the browser and we can create a new TeamCity project there. To do so, follow these steps:
- Once you have logged in to TeamCity UI, click on Create project:
- To connect to our project from GitHub, click on From GitHub on the next screen:
- This will open a popup with instructions to add a TeamCity application to your GitHub account:
- Click on the register TeamCity link and it should take you to the GitHub page where you can register a new OAuth app.
- Give the details of the application, homepage URL, and callback URL, as shown in the following screenshot, and register the OAuth app:
- Once you register, on the next screen you’ll get a Client ID and Client Secret; copy those details since they will be required for the TeamCity project:
- Go back to TeamCity, put the Client ID and Client Secret in the required fields, and click Save:
- Next, you need to do a one-time sign in to allow TeamCity to use GitHub repositories. Click on Sign in to GitHub:
- Authorize the TeamCity app to use GitHub by clicking on Authorize app:
- Once authorized, select the PhoneCallApp repository from the list of repositories shown on TeamCity:
- On the next screen, TeamCity will offer to create a new project from the URL selected. Give it a name and click Proceed:
- This should create two things. The first is a trigger in TeamCity for each code check-in you do; each will trigger a build. The second is a build step from the repository automatically:
- We need to configure the build steps manually and use the build scripts described in the Creating a build script section. Use those scripts, described sequentially in previous steps, to create the build steps in TeamCity.
- Finally, your build steps should look like the following screenshot, consisting of all the steps mentioned in the Creating a build script section:
- Now, your TeamCity continuous build is ready, and a trigger is already configured to perform this build on each code check-in, or whenever it finds any code changes in the repository. This finally provides you with an Android package that is ready to be distributed.
To summarize, we created a TeamCity project for Mobile DevOps. If you found this post useful, do check out the book Mobile DevOps, to continuously improve your application development lifecycle.