Build anything using VSTS Cloud-hosted Mac, Windows and Linux build agents
Articles,  Blog

Build anything using VSTS Cloud-hosted Mac, Windows and Linux build agents


>>Hi, this is Damian. In this video, I’ll
show you how you can use cloud-hosted agents
to build on Mac, Windows, or Linux without needing to manage
infrastructure of your own. I have a Xamarin form as
project for iOS and Android, plus a web API for the back end
written in ASP.Net Core. In this scenario, I
want to build all of these projects at the same time in the same build definition, but each project needs to be built on a different
operating system. The iOS project on a Mac, the Android project on Windows, and I’ll build the web API
project on a Linux machine. So let’s have a look at the build definition
we’ve created. I’ve separated this build
definition into three phases, one for each of the projects
we want to build. You can add new phases
by clicking the ellipses at the top
of the definition here. For each of these phases, we can choose the agent
that’s used to build them and we have a number
of hosted options here. To meet our requirements, we’re building the iOS app
with the hosted Mac agent, which is inherited from the default for
our build definition. We’re using the
Hosted VS2017 agent for the Android app
and for the web API, we’re using the
hosted Linux agent. These agents are
provisioned and managed by VSTS so you don’t have to worry about running them
on your own machines. We spin them up and tear
them down on demand. In each of these phases, we’re building the project
then uploading the artifacts to
a drop folder in VSTS, where they can be used
later as part of a release. You can get an idea of
the capabilities of each of these hosted agents
by going to the “Agent Queues” administration page and choosing “Capabilities”. Each hosted queue contains a virtual agent that shows you some of the tools that
will be installed. Let’s go back to our build page
and queue a new build. Now as the build is running, you can see that each of
the agent phases is being run independently in whichever order agents are made available. However, if you need to, you do have the option of making faces dependent on each other. For example, if you had a common library that was
used by all the other phases, you can add those dependencies to the phase in
the build definition. On completion of the build, you can see that
the artifacts from each of those agent
phases has been uploaded to VSTS and they’re available all
in the same place. We can use the hosted
agents both in build definitions and also
in release definitions. This is useful in scenarios
where you might need to run certain deployment tasks on
specific operating systems. So there you have it.
Hosted build agents are a great option for your builds no matter what platform
you require.

Leave a Reply

Your email address will not be published. Required fields are marked *