Reader small image

You're reading from  Mobile DevOps

Product typeBook
Published inMar 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788296243
Edition1st Edition
Languages
Concepts
Right arrow
Authors (2):
Rohin Tak
Rohin Tak
author image
Rohin Tak

Rohin Tak is a mobile and web development enthusiast with expertise in and several years of experience of .NET technologies. Professionally, Rohin has worked for IBM and OnMobile Global as a .NET developer and Xamarin developer respectively. Rohin is now working as a senior software engineer at LeadSquared, one of the fastest growing sales and marketing automation solutions in India. In his spare time, Rohin is mostly found trekking in the Himalayas and exploring new places around the globe.
Read more about Rohin Tak

Jhalak Modi
Jhalak Modi
author image
Jhalak Modi

Jhalak Modi is a DevOps engineer with a deep interest and expertise in implementing large-scale cloud, big data, CI/CD, and automation solutions on a variety of public/private/hybrid clouds, as well as on-premises. She is an AWS Certified Solutions Architect and DevOps professional with more than 10 certifications in trending technologies. She is also a public speaker at AWS events, universities, meet-ups, and corporate trainings. Currently, working with KOGENTiX, Singapore, she has previously worked with Wipro Technologies and Electromech Corporation.
Read more about Jhalak Modi

View More author details
Right arrow

CI/CD for Android with Visual Studio Team Services

In the last chapter, we learned about continuous integration and various tools to implement it in a development life cycle. We also learned in detail about continuous integration using TeamCity as a CI tool.

In this chapter, we will go into more detail about continuous integration and continuous delivery using Visual Studio Team Services (VSTS) as a tool. We will be discussing all the steps that you require to set up and put VSTS to work.

VSTS is another tool provided by Microsoft for DevOps that works with almost any third-party DevOps chain tool in the market. It has great integration with GitHub, Jenkins, Azure, and many other similar tools for your continuous integration needs.

Some of the topics covered in this chapter are as follows:

  • Creating an account in Visual Studio
  • Getting the code from GitHub
  • Creating the build definition...

Creating an account in Visual Studio

To get started with VSTS, head to your web browser and follow these steps:

  1. Open Microsoft's website at this URL: https://www.visualstudio.com/team-services/.
  1. On the website, you'll see a Get started for free button, as shown in the next screenshot. Click on that button:
  1. Clicking on the button will take you to the signup page, where you can log in using your existing Microsoft account:
  1. If you don't already have a Microsoft account, then you can click on the Create account link on the same page.
  2. Clicking on the Create account link will take you to the next page, where you can choose a username and password for your account and click Next:
  1. It might ask you to verify that you are an actual person creating an account, so after completing that step, your account should be ready to use.
  2. After completing the signup form,...

Getting the code from GitHub

Now that your account is created, it's time to import your code into VSTS:

  1. On the next page, you'll see different options to integrate your project from your computer, using the command line and even by initializing a new Git repository.
  2. We already have our project synced on Git, so we'll be choosing the option to import a project from Git, as shown in the following screenshot:
  1. Clicking on the Import button will open a small popup window where you can choose either Git or TFS as your source type and provide your repository URL.
  1. Please note that it will require you to give this application permission to access using your Git credentials:
  1. After providing the repository URL and login information, click on the Import button.
  2. This will import your project from Git into the VSTS server, where you then can manage all the processes...

Creating the build definition

Creating the build definition in VSTS is a straightforward and simple process. It provides you with templates for various tools to help you create build definitions.

Follow these steps to start creating the build definitions for your project:

  1. On the code page, click on the Set up build button, as shown in the following screenshot:
  1. This will take you to the next page where you can select a predefined VSTS template to use.
  2. On the next page, select GitHub or your choice of any other source versioning the build would be connecting from.
  3. Give a connection name in the input box provided and click on the Authorize using OAuth button:
  1. A pop-up window will open; you might need to unblock the popup from the VSTS website to see it.
  1. Authorize and give VSTS OAuth permissions to access your GitHub repository:
  1. Click on the Authorize vsonline button to...

Configuring the build definition

VSTS has great support for the Xamarin application build process, and automatically takes all the steps you might require for the project's build configuration. But, you might need to provide some extra information for some of the build steps involved:

  1. You will see the build steps already in place on the next page in VSTS:
  1. Let's stop here for a second and look at the build steps provided by VSTS, all automatically set up for you to just start the build.
  1. It's a good idea to have a brief look at the steps involved, starting from Nuget package restore, to building the packages, and finally to publishing them:
  1. Here we need to provide some information related to our Xamarin Test Cloud account so VSTS can run Test Cloud tests there.
  1. Click on the Test step on the left-hand side of the screen. It will highlight the required information...

Queue build

All the configurations are done, and now we can save the configuration and queue the build:

  1. Once the preceding steps are completed, click on the Save & queue button at the top of the build configuration page:
  1. Give your name to the build and commit comments, and click Save & queue:
  1. Once the build is saved and queued, you'll get a small notification, as shown in the following screenshot:
  1. Congratulations, you have now successfully completed the build configuration and queued the build for execution.

Triggers - build with every commit

Now we have covered how to configure the build steps and queue them manually. In continuous integration, it is important to automate the build, especially whenever developers check code in. This helps keep the latest build up to date with all the changes made and lets developers know of any issues in the build at earlier stages of development.

Follow these steps now to set up triggers and automate the build:

  1. Click on the Triggers tab in the configurations section shown in previous steps:
  1. In the Triggers tab, in the left pane, you'll see a section for Continuous integration, under which you will find your repository linked.
  2. Click on that link to open the continuous integration section on the right-hand side:
  1. Check the Enable continuous integration box.
  2. You'll notice there is one more checkbox, to Batch changes while build in progress...

Summary

In this chapter, we discussed continuous integration using VSTS, a great tool for CI needs if you use a lot of Microsoft tools in your development life cycle, especially Xamarin. We learned how to configure build steps in VSTS and integrate the Xamarin Test Cloud Teams API for continuous testing, and at the end, we set up triggers for continuous builds.

In the next chapter, we'll discuss deploying and migrating your applications to the cloud.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mobile DevOps
Published in: Mar 2018Publisher: PacktISBN-13: 9781788296243
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Rohin Tak

Rohin Tak is a mobile and web development enthusiast with expertise in and several years of experience of .NET technologies. Professionally, Rohin has worked for IBM and OnMobile Global as a .NET developer and Xamarin developer respectively. Rohin is now working as a senior software engineer at LeadSquared, one of the fastest growing sales and marketing automation solutions in India. In his spare time, Rohin is mostly found trekking in the Himalayas and exploring new places around the globe.
Read more about Rohin Tak

author image
Jhalak Modi

Jhalak Modi is a DevOps engineer with a deep interest and expertise in implementing large-scale cloud, big data, CI/CD, and automation solutions on a variety of public/private/hybrid clouds, as well as on-premises. She is an AWS Certified Solutions Architect and DevOps professional with more than 10 certifications in trending technologies. She is also a public speaker at AWS events, universities, meet-ups, and corporate trainings. Currently, working with KOGENTiX, Singapore, she has previously worked with Wipro Technologies and Electromech Corporation.
Read more about Jhalak Modi