A closer look into VSTS Build and Release Management
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 96 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/51693 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
Data managementBuildingLink (knot theory)Cloud computingOnline-AlgorithmusDemo (music)Visualization (computer graphics)BitService (economics)System callPresentation of a groupLaptopInformation technology consultingWindowSource codeComputer animation
01:30
Data managementBuildingStructural loadSoftware testingMaxima and minimaMiniDiscChemical equationLaptopBitTemplate (C++)Closed setMereologyValidity (statistics)VarianceExtension (kinesiology)Demo (music)Point cloudInformation technology consultingSource codeRevision controlCuboidCross-platformDifferent (Kate Ryan album)BuildingData managementRight angleDefault (computer science)Branch (computer science)Digital photographyMultiplication signFile formatRepository (publishing)NumberTask (computing)Connectivity (graph theory)Process (computing)Service (economics)SoftwareDirection (geometry)Mobile WebPhysical systemComputer file.NET FrameworkoutputParameter (computer programming)Remote procedure callPoint (geometry)Scripting languageGUI widgetWeb pageProduct (business)Game controllerReliefShift operatorPower (physics)Gastropod shellCore dumpVirtual machineProjective planeLine (geometry)Ferry CorstenStaff (military)Musical ensembleSurfaceConfiguration spaceComputing platformFigurate numberOnline helpSoftware testingQuicksortForm (programming)WindowWorkstation <Musikinstrument>Server (computing)MultilaterationInformationMathematicsMonster groupComputer animation
10:39
Source codeCloningRepository (publishing)Task (computing)Scripting languageGastropod shellBuildingPower (physics)GoogolScripting languageWindowComputer fileSoftware framework2 (number)LaptopBitBuildingVirtual machine.NET FrameworkFunction (mathematics)System callCountingComa BerenicesState of matterLine (geometry)Video gameGastropod shellComputer animation
13:20
Scripting languageBuildingDemo (music)Computer networkAsynchronous Transfer ModeRouter (computing)Data typeDefault (computer science)Simultaneous localization and mappingRankingLeakData managementQueue (abstract data type)Multiplication signComputer fileDefault (computer science)MiniDiscComputer animation
15:10
Directory serviceSerial portVolumeNumberConfiguration spaceBuildingAnnulus (mathematics)Task (computing)MaizeDirectory serviceFigurate numberComputer fileConfiguration spaceConnected spaceVirtual machineComputer animation
16:01
BuildingStapeldateiMaxima and minimaAnnulus (mathematics)SoftwareConnected spaceDifferent (Kate Ryan album)BitComputer animation
17:17
StapeldateiDefault (computer science)Computer fileServer (computing)Configuration spaceService (economics)Installation artBuildingDemo (music)WritingQueue (abstract data type)Information systemsElectric currentVideo game consoleUsabilityComa BerenicesCloningComputer virusScripting languageConvex hullComputer-generated imageryVariable (mathematics)Java appletTask (computing)MultiplicationVirtual machineQueue (abstract data type)Server (computing)Default (computer science)Multiplication signWindowArithmetic meanRoundness (object)State of matterWeb crawlerFigurate numberLevel (video gaming)Function (mathematics)Statement (computer science)Coma BerenicesSelf-organizationSource codeLatent heatPresentation of a groupMonster groupDifferent (Kate Ryan album)QuicksortBuildingVideo game consoleService (economics)Shared memoryGame controllerConnected spaceSoftware testingScripting languageFirewall (computing)Computer animation
23:33
BuildingUsabilityDemo (music)Default (computer science)Scripting languageQueue (abstract data type)Intrusion detection systemRule of inferenceSupremumPhysical systemEstimationGastropod shellMenu (computing)ExplosionGamma functionRepository (publishing)Source codeContinuous functionTask (computing)Computer configurationInclusion mapExecution unitHydraulic jumpElectronic meeting systemMaizePiGastropod shellVariable (mathematics)Integrated development environmentJava appletRevision controlScripting languageMathematicsLatent heatVirtual machineDifferent (Kate Ryan album)SoftwareBuildingMedical imagingService (economics)Demo (music)Directory servicePhysical systemRootkitInstallation artTask (computing)Point cloudLimit (category theory)ECosFigurate numberPower (physics)Process (computing)Mixed realityProjective planeFIESTA <Programm>Direction (geometry)RoutingSurjective functionComputer animation
29:49
Data typeBuildingExtension (kinesiology)Default (computer science)Client (computing)Queue (abstract data type)Video game consoleElectric currentConvex hullDenial-of-service attackBranch (computer science)Fibonacci numberMenu (computing)Demo (music)Message passingLink (knot theory)Installation artLocal ringComputer configurationAssembly languageSoftware testingUsabilityCodeComputer fileControl flowVariable (mathematics)Visual systemIdentity managementNim-SpielInclusion mapExecution unitLeakEmulatorParallel portError messageMultiplication signBitProcess (computing)Human migrationMessage passingCASE <Informatik>Queue (abstract data type)Installation artVariable (mathematics)Source codeBuildingCodePoisson-KlammerBoundary value problemDirectory servicePasswordServer (computing)Sign (mathematics)Computing platformWebsiteTemplate (C++)BefehlsprozessorBinary multiplierBlogWindowJava appletRevision controlAsynchronous Transfer ModeParameter (computer programming)Data structureDifferent (Kate Ryan album)Integrated development environmentFerry CorstenMathematical analysisConfiguration spaceWeb 2.0Visualization (computer graphics)Execution unitFile formatTask (computing)Computer configurationComputer fileDatabaseFunction (mathematics)Type theoryOpen setTouchscreenLoginSound effectConnectivity (graph theory)Software testingPower (physics)Gastropod shellDrop (liquid)Boss CorporationMonster groupLevel (video gaming)Parallel portUniform resource locatorRow (database)Direction (geometry)CuboidWordComa BerenicesMatching (graph theory)Water vaporSymbol tableFood energy1 (number)FIESTA <Programm>Limit (category theory)Computer animation
37:37
Token ringBuildingUsabilityPlastikkarteRepository (publishing)Continuous functionLandau theoryBranch (computer science)Smith chartInclusion map19 (number)Source codeConvex hullMathematicsSimultaneous localization and mappingFiber bundleSoftware testingExistenceMaxima and minimaCodeComputer fileReading (process)Execution unitError messageHill differential equationInternet forumDemo (music)Computer configurationLocal GroupTask (computing)Point cloudWechselseitige InformationMIDIMathematicsScheduling (computing)BuildingTask (computing)Integrated development environmentGroup actionPay televisionComputer fileError messageMultiplication signDifferent (Kate Ryan album)BlogUnit testingPhysical systemResultantBranch (computer science)BitMiniDiscOrder (biology)Template (C++)Token ringSource codeVirtual machineDot productWater vaporCuboidSoftware testingCodeSystem callInformationTraffic reportingMoment (mathematics)NumberTerm (mathematics)Dimensional analysisCASE <Informatik>Level (video gaming)Execution unitScaling (geometry)EmailINTEGRALData storage deviceImplementationPower (physics)Server (computing)Gastropod shellReading (process)Software developerSoftware bugGUI widgetPersonal identification numberTouchscreenValidity (statistics)Repository (publishing)Field (computer science)AuthenticationRepresentational state transferLoginContinuous integrationComputer animation
44:57
Structural loadComputer configurationDemo (music)Point cloudScripting languageSynchronizationAirfoilSource codeMenu (computing)MIDIBuildingField (computer science)Maxima and minimaExecution unitVariable (mathematics)Drill commandsView (database)Wage labourCivil engineeringIntegrated development environmentFile formatFormal grammarServer (computing)Function (mathematics)BuildingDependent and independent variablesIntegrated development environmentRepository (publishing)Product (business)Data managementTask (computing)DataflowLevel (video gaming)Theory of relativityComputer fileParameter (computer programming)SubsetCartesian coordinate systemCASE <Informatik>WebsiteTrailService (economics)Variable (mathematics)Validity (statistics)Phase transitionSoftware developerWeb 2.0NumberWeb applicationCondition numberPoint (geometry)Group actionDirectory serviceLink (knot theory)Data acquisitionVirtual machineFIESTA <Programm>Process (computing)Conservation lawOcean currentSound effectConnectivity (graph theory)Computer animation
52:17
Computer configurationDemo (music)Annulus (mathematics)Integrated development environmentPiLink (knot theory)Menu (computing)Sign (mathematics)Android (robot)BuildingTask (computing)Java appletChi-squared distributionExtension (kinesiology)Product (business)Visual systemEmpennageEmailSoftware testingLevel (video gaming)Extension (kinesiology)Installation artPlanningProduct (business)Proof theoryCASE <Informatik>Multiplication signFunction (mathematics)EmailBuildingScripting languageDifferent (Kate Ryan album)Demo (music)Task (computing)Computer animation
54:55
Duality (mathematics)Computer-generated imageryFiber bundleoutputGoogolDescriptive statisticsSoftware repositoryTask (computing)Web pageRevision controlDirectory serviceConfiguration spaceMessage passingIdentity managementGraph coloringMaxima and minimaReading (process)Scripting languageExtension (kinesiology)Power (physics)Gastropod shellSound effectMedical imagingLine (geometry)Right angleRational numberCASE <Informatik>Computer animation
56:38
Sign (mathematics)Revision controlExtension (kinesiology)Computer iconHill differential equationMusical ensembleQueue (abstract data type)Limit (category theory)Variable (mathematics)LaptopTask (computing)EmailVariable (mathematics)Data miningRevision controlSoftware repositoryComputer animation
57:56
Data typeBuildingDefault (computer science)CloningExact sequenceElectric currentScripting languageDemo (music)Maxima and minimaMessage passingMonster groupVirtual machineRevision controlTask (computing)Extension (kinesiology)WritingMessage passingRight angleCASE <Informatik>Demo (music)Computer animation
59:01
Convex hullMessage passingTask (computing)Directory serviceSinguläres IntegralVariable (mathematics)Configuration spaceWechselseitige InformationDemo (music)Queue (abstract data type)WritingBuildingMessage passingWritingTask (computing)Web browserSelf-organizationConnected spaceStress (mechanics)BitInternetworkingBuildingFunction (mathematics)Variable (mathematics)Software developerDiscounts and allowancesRight anglePresentation of a groupUtility softwareComputer animation
Transcript: English(auto-generated)
00:05
Welcome. I understand fully that there was a party last night. So thank you for being here so early at 9 o'clock. There is not much people. I think that most of them are still in bed, sleeping.
00:21
So let me start with a short introduction. I have two laptops here, and that's why. Came here this morning at 8 o'clock. Started down my laptop. And now it says this, updating Windows. So all the demo preparations that I did.
00:43
Nice presentation, nice Spotify playlist, nice demos. It is going to be a little bit different now, I think. So I have the laptop of my colleague. My other laptop is at 88%. So I have good hopes that during this session
01:02
it will come up again. I have some demos that I can only do on this one because I prepared it here. But most of the stuff that I'm going to show you is in the cloud. It's on Visual Studio Team Services. That's a cloud service. And it's on Azure. It is also a cloud service. So I think I can manage a whole lot to show you today.
01:21
So that's what I'm going to do. This PowerPoint Online, that's my only slide, so I will close this down. And then I will just start because I thought it was nice to have a demo-only session. So first I want to introduce myself. My name is Rene van Oostnaberge.
01:40
I'm a lead consultant at Expirit in the Netherlands. We are a firm that consults in ALM, in Azure, in cloud and mobile. And I help companies improving their software processes. So I really look broadly to people, process, and tools. And my expertise is Visual Studio Team Services and Team Foundation Server. I'm an ALM MVP as well.
02:02
And this photo was taken at Build. So I also have the HoloLens part in my session. There is also that HoloLens session next to me. So all the other people that are not in bed are probably there. So this was a great experience that I had there. And I can really recommend everybody to just, if you have the chance, just try it out.
02:22
Because it's really, really awesome. Then in private, I have a wife and two kids. My oldest is five and my youngest is two. Yesterday, or two days ago, he was two. And that's it. I like to run sometimes. So without further ado, I want to just start with the demos.
02:42
And then let me start my timer. Otherwise, I will just hopelessly run out of time. So first question. Who works with VSTS already? OK, OK. And who works with the build and release management system already? Oh, OK.
03:01
And then I hope that I can tell you some new stuff. So this is the intro page. So this is the dashboard. You can create all kinds of widgets. And you can create your own stuff. And you can put everything on there. So it's more a dashboard for entry point of VSTS. And there is also the work hub, which we can use to do
03:24
some work item management. So to walk you through what we are going to do today, I created a small backlog. I already did the preparation, but not properly, because my laptop crashed and was updating. I already did the introduction, and now I'm going to do the agenda.
03:41
So what I'm going to do today, I'm not going to show you all the build steps that are in the box. I'm not going to do, OK, this build step can do that. And this build step can do that. I want to really dive into what is build and release management? What are the conceptual things behind it? How do the agents work?
04:01
How does the infrastructure work? How does the cross-platform build agents work, which only run on that machine? So I can show you the stuff that is really below the surface, because all the tasks, it's really situational. And it depends on the situation that you're in, what and how you are going to use it.
04:21
So that's what we are going to do first. Then we are going to set up a build. We'll talk a little bit about setting up tests, updating, et cetera, et cetera, capabilities and demands, triggers, et cetera. Then we walk into VSTS release management, which you
04:44
can see it's quite similar as the build system, only you have the approval and validation parts in there as well. And then lastly, if my laptop works again, we can do some customization and extensions, and I can show you how that works, and I will show you a cool extension.
05:00
Before I continue, my laptop is responding again. I can log in. So if everything works here, I can just start. So I can start with the simple demo here, and then I can maybe move over. So first of all, I move to the build tab. This is where everything happens. So as you know or might not know, Microsoft had first
05:22
XAML build engine. Who used XAML build engine? Who liked it? So I think that the main reason why people use Jenkins and TeamCity was because of the XAML build engine. It really was bad. You could do stuff, but if you wanted to do something
05:42
a little bit different than what was out of the box provided, you came into customization, and that was really, really hard. You had to build assemblies, and you had to put them in source control, and you had to configure your controllers, and it was really, really hard to do. So Microsoft understood that, and they said, OK, we are
06:02
going to build a new build engine. We are going to build a build engine that is easily customizable, that can easily be extended, and that is very, very lightweight to run. And that's what they did. And I think, and I use Jenkins at my assignment right now, and I think it's better. I think it's really, really good. It's really fast, and it's really handy in use.
06:23
So let me just start with a simple build definition. When I press Create new build definition, I can select templates. And what is a template? It's just a blueprint of something that I already did, or what is provided out of the box by Microsoft. And as you can see here, it's not only a
06:41
Microsoft-based template. You can see Android, you can see Ant, you can see Gradle, you can see Maven. So it's not only Microsoft-related stuff that you can do, you can also do non-Microsoft-related stuff. This is really great. So you have also deployment templates, which is nothing more than a build template with some build steps in there
07:04
that can do deployment stuff. And I can have custom templates, so you can create your own template. For example, for your own components that has certain steps that you always want to follow, or certain build numbers that has a certain format. And you can just save those templates, and you can just
07:23
create them from here. And then I can just say next, and then I will have this template as a base. Then I can select a repository. The repository is not only VSTS. You can select a VSTS repository, and then I can
07:42
select both. I can select a TFVC, so Team Foundation version control repository that resides in the same team project, or I can select a Git repository. What else I can do is I can move to GitHub. I can create a service endpoint to GitHub, and I can extract my sources directly from GitHub and use the build
08:01
engine of Microsoft and VSTS to just build my sources from GitHub directly. There is also the remote Git repository, which is just somewhere, and subversion. Who uses subversion? I don't know why it's there. I think they're just good. So I select a repository, I select the default branch that
08:22
I'm building, and I can select the agent which I'm running on. So I'll come back to agents a little bit later, but this is now the hosted agent. So Microsoft has a pool of agents somewhere in the cloud that you can just use. So if you don't have fancy stuff to do, and you don't want to set up infrastructure, you can just point to the
08:41
hosted pool, and Microsoft provides the agents for you. So I can create. And then first thing I need to do is I can create a build step. A build step is a simple, lightweight zip file. You should see it as a zip file, which has a manifest
09:03
which describes the task. So you can see the name and the title and the input parameters and stuff. And it contains a PowerShell script or a Node.js script, which is executed when you execute the build step. Microsoft is moving to Node and to .NET Core, because
09:22
that's cross-platform. If you use PowerShell, it can only run on Windows-based machines, of course. And if you use Node or you use .NET Core, you can use the same build tasks on multiple platforms. So Microsoft is really moving all their tasks to their new infrastructure. But most of them now are still in PowerShell, and you
09:43
can see the variance there. So let me just start by adding a simple PowerShell. And I can hit Close. So I add a PowerShell script. I can choose whether I want to use inline or file path.
10:02
And then I can just write some PowerShell script. So let me just be simple and easy. And I can just say, hello, NDC. Save the template. I can give it a name. So let me just say first, look build, for example.
10:22
OK. And then I just queue the build. So really simple. If I selected the template with contain more steps, it was somewhat more configuration. But I can just now hit Enter. And now it will just start up my build. It will look in the hosted pool for an available agent.
10:44
And what you see sometimes, if it's a little bit more busy, it takes a few seconds to just get an agent that is available to run my build. And then it's running. So what you see here is hello, NDC. So that's the output of my PowerShell script.
11:03
Nothing fancy here. So let's dive a little bit further. For example, if I add another build step and add a PowerShell script, make it inline again, and I just say,
11:24
for example, I want to do a curl statement. So I want to do curl http google.com. And I will save this.
11:41
If I queue the build now, it will, of course, run my first PowerShell script again. But what we'll see is that it will probably not run on the hosted agent. It will crash.
12:06
And this is what I mean by it takes a while sometimes to connect to the hosted agent.
12:29
So you will see it crashes. Why? Because on the hosted agent, curl is not installed. So the hosted agent does not contain everything you want. It contains the basic stuff.
12:41
It contains the .net frameworks and everything that you can expect from a Windows agent or a Linux agent, but it doesn't contain the tools that you need sometimes. So you can do two things. You can either provide the tools that you need by putting the .exe files that you need to run curl, for example, and just copy it to the agent and then execute
13:02
that .exe to do your thing on the hosted agent. Or you can run a on-premise agent. And that's what we are going to do. And my laptop works. So I'm going to switch machines. And then I'm going to show you on this laptop. So give me a sec.
13:55
So I opened up the build that we just created. And what I want to do now, I want to switch to my
14:01
on-premise agent. So for that, I'm going to the General tab. And I go to the default agent queue. And I press Manage. I need to maybe connect.
14:25
So here we are. So in my management, I have queues. I have a default queue. I have multiple queues. And I have this hosted queue. So the hosted agent, it's always online. If this one is red, something is wrong at
14:41
Microsoft, so we cannot do anything about it. This is always green. So we have the default pool. And we can create all kinds of agents in here. So what do we do? We can download an agent. If I press this one, and I won't do it for the time that I lost, it will download a zip file for me. And that zip file contains some files.
15:00
You unblock the file. Very, very important to unblock the file. And then you extract the file to your local disk. So when I go to my command line, I have a NDC agent. So this is what it kind of looks like.
15:21
So you have the agent directory in configure and a run. That is what you initially get when you extract the file. Then you are going to configure the agent. So what that does, it wants to know to which collection am I connecting? How is this agent called, et cetera, et cetera. So it will now, hopefully, start connecting.
15:49
Maybe I should switch back to the other machine.
16:24
Let's try something different. I will just try to download the agent again. So I will download the agent. I think the network connection is a little bit slow.
16:44
This is the agent that I downloaded. So I will just copy this one. Create a new folder, NDC A. Extract it here.
17:15
And let's try to do this one.
17:38
I don't know why this is not working.
17:40
OK, so I have to configure the agent. So I can say the name of the agent, the name of my server that I'm connecting to, .com, the pool to which
18:01
I'm connecting. So you can create pools of agents. And you can share those pools amongst different collections that you have. In VSTS, you only have one collection. And one collection can have a pool. And you can attach a queue to a pool. If you have multiple collections, you can create another queue on another collection and connect it to
18:21
the same pool. So that's how you can share your build infrastructure in your organization. If you used XAML builds before, you had a build controller, and a build controller ran on a machine. And it connected to one single collection. If you had another collection that you also wanted to use for your builds, you had to create a new machine with a new build controller.
18:41
So it was not really scalable to do your build infrastructure. So instead, we can now share build queues. So I'm connecting to a build queue. Where do I want to get my sources? And I can say, do you want to run this service as a Windows service?
19:00
Or do you just want to keep running in your console? What I usually do is I don't use the hosted agent much. Most of the time, I just run in my console on my local machine. So when I'm creating builds, I just run a console and testing the builds. Because then it gets all the sources that I'm doing on
19:23
my local machine. And I can easily debug. I can easily do stuff on the sources that it gets. I know what happens exactly because it's on my machine. And once it's running, I just will run on the build agent somewhere in our build infrastructure. So that's a really convenient way to just easily start up a new build agent or multiple build
19:42
agents at the same time. So now I will just connect to my thing here. So I will sign into my account. So this build agent without firewall stuff, it connects to
20:02
the default port. It will connect to my VSTS account. And it will just start running. So here it's running. And in my, I have to start up somewhere here as well.
20:20
That's all the preparations that I missed. So here you can see that I have the rvodel2. That's the agent that I just started up. It's now running on this machine as well. I will just, can I just remove this one? No. So when I go back to this build, and if you still
20:44
remember because of all the ado, we did a curl statement on this build. When I queue this build, I can say I want to run on the default queue. So not on the queue in the cloud, but on the default queue, and I can run.
21:04
VSTS starts the build. It puts it in a queue. The queue finds an available agent. And then it starts to run the build. And you can see that it finds the rvodel2 agent, because that's now the only agent that is available. Because the other agent on that machine that I used
21:22
before, I disabled that. So it can only find one agent, so it will run there. So it will get sources, and then it will execute a PowerShell script twice, hopefully. OK. Not recognized.
21:40
So probably I did something wrong in the, OK, thanks. But when I do this, it will run, and it will show me the output of the curl statement. That's not very interesting. But what is interesting is, so let me change this back so
22:02
that it is default on the default queue. And let me then quickly change this as well for the next run. What is interesting is that probably, obviously, when I run a build, sometimes it happens that my agents are not
22:24
capable of running that build, because they don't have the tools that I need to run that build. So how can I manage that? How can I make that controllable? And we can do that by adding demands. So on this general tab, I also have demands.
22:41
And this demand means that I can say, I want to be something present on the build server when I run this specific build definition. I can say, for example, I want curl to be present. Curl must exist on this build agent.
23:01
I can save. This is a manual step, so I can add anything that I want. So if I can sort of tag my agents and tag my build, so this build is a update to build, and this build is a legacy build. So I can do all the demands.
23:21
But there are also tasks that you can add. For example, there is a task Gradle that I can add. And this Gradle task, it automatically adds the demand Java. So if I want to run a Gradle, it demands that Java is
23:42
installed on the machine that I'm running on. So the task is configured to add that demand automatically. So let me just quickly remove that. When I run the build now, it tells me there is no agent that is capable of running this build.
24:02
You demand curl, but there is no agent with curl. So, sorry, you can queue it and wait forever, or you can just fix it. So what we are going to do, of course, is trying to fix that. If I move to my agent that I just created, there is a tab Capabilities.
24:22
So demands and capabilities, they are a pair. I demand something, and my agent should have that capability to be able to run that. So what you can see here is that there are system capabilities. So Chef, DNX, Java, that's all system environment variables on my system.
24:42
These are the tools that I have installed on my systems, and it just reads the environment variables, and it knows that Java is installed. If I need something extra, I can just say curl. And, for example, one, or true, I don't care, because I just checked that curl exists. So if I save the changes here, and I run this build again,
25:05
then it will automatically queue, and it will find an agent, and it will only run on agents that have that curl capability configured on true. So it will now hopefully run, and even run without
25:21
errors, because I just fixed it. So here is the curl output. So this is all the queue, and the pool, and how can you manage your build agents with demands and capabilities. So this is how you can steer your builds in your build infrastructure.
25:41
This is not cross platform yet. So what I want to show you now is I want to do the same thing for the build, but run on a Linux-based agent. So when we create a new build definition, and I will just do an empty build definition again, I will just select my NDC project, create, and I add a build
26:06
step, but I'm not adding a PowerShell script, but I'm adding a shell++ script. So this is the Linux-based thing to run PowerShell, for
26:20
example, or a command line. So I can just say echo as well, NDC. And if we look at the demands, it demands sh. It demands shell to be present on the agent that I'm running on. So if I press save now, and I would just say Linux, save,
26:44
and I queue this build, I don't have an agent. I don't have a Linux agent running yet. So we are going to fix that. So I have a Linux machine running in the cloud. And I need to quickly look up my password here.
27:14
So this is a Linux machine. And what I can do is I can, of course, download the agent
27:21
on this Linux machine, which I did. So there is a build agent here. But on Linux, we can do other stuff as well. We can also say we are going to run Docker, because Docker is a very, very lightweight virtual machine like thing.
27:41
Who knows Docker, the concepts? OK. So instead of installing the agent on the machine, because the machine has all the environment variables, I have a specific version of Java, and I have a specific version of whatever, node, then I can only have agents that run
28:01
on that specific version of software. While when I create virtual machines, I can have many virtual machines with agents installed and run different versions of software on that. So I can sometimes run with Java 7 and sometimes run with Java 8 or whatever. But if I do it in Docker, it's all the benefits of the virtual machine, but still smaller and
28:22
very easy to roll out. So what I did is I created a Docker image that's called xpirit.vsts.buildagent that has node installed. It's just a Docker container with the build agent configured and installed already, but
28:41
it's not running yet. So if I'm going to run this container by saying docker run minti xpirit slash vsts build agent bash, it will start up the container, and you can see how quickly it is, because it's already done.
29:01
And then I can see the agent directory here. So I will go into there. And then I can say switch user, because I cannot run this service as a root user. That's not allowed on Linux, so I have to switch to another user.
29:20
And then I can just say run. It asks me for my username to connect. I already configured this agent to look at my collection. I run, and you can see it's just easy starting up this container. And I can also do it by docker run that it
29:41
automatically starts up the agent already, because then you don't have to configure it manually, but this is just for demo purposes. So when I look now, I have a Docker agent running as well. So when I queue this build now, it will go to the same
30:01
queue and finds me an agent that has SH installed. And that is, in this case, my Docker agent. And then it will just automatically pop up my NDC message here as well. So you can imagine, and I won't show you now because I want to save a little bit time, that if I just exit
30:21
this container and say, OK, I now want to run another container with a Java version 8 installed, and I'm doing a Java build, which demands me a Java installation, I can just easily start up a new container. For example, the VSTS build agent Java, it automatically
30:42
pops up, and the whole infrastructure makes sure that it will run on the container that is capable of running that specific build. So I did two blog posts on build agents in Docker containers, both on Linux and Windows, because Windows is also now capable of running Docker containers in
31:01
a preview mode. So you can look at roadtoalm.com, and there are two blog posts there that describe how to do this. It's a really convenient way to just quickly start up new agents and do some configuration there. So that's really great. So leaving my Linux build for what it is, because after all,
31:25
I'm still a Windows guy, let us walk to the rest of this build possibilities. So I opened up the wrong one. So let me open up this one.
31:41
So let me walk you through a template. So if I choose the template Visual Studio Build, it will provide me this template. So it will do some NuGet restore, it will do a Visual Studio Build, it will run some unit tests that it can find, it will publish symbols.
32:01
And then I added two tasks, copy files, which is more or less create a nice structure for your build drops. So you can publish artifacts to your build, but if you do nothing, it will just publish everything that's in the binary directories, and you have everything.
32:21
But if you want to have nice folders, for example, I want a folder with my website, and I want to have a folder with my tests, and I want to have a folder with my other components, you can use the copy files tasks to just copy everything to a subdirectory. And then at the end, you can just publish the whole lot as
32:41
a build artifact to the build. So that's what I did. If I am going to look at the solution, then what you will see is that we have values in the MSBuild arguments. And for me, there was something to get used to,
33:01
because normally when you use the XAML builds, you just said, OK, I want to build this solution. And then you had some check boxes, like I want to do code analysis, and I want to create an MSDeploy file, and it were just check boxes, and then you could run, and then you had it. The new build agent, it is very lightweight, and it does
33:22
not really things for you. There are steps that can be created that does the stuff, but it's doing nothing automatically. So if you want to do Visual Studio build, and in my case, I'm building a website, and I want to copy a zip file, I
33:45
have to do some MSBuild magic. So you have to know MSBuild a little bit more than you maybe did before when using the other stuff. You have to know what's happening inside MSBuild, what MSBuild needs to be able to do the stuff.
34:02
So in this case, I want to do a web deployment, so I have to add the parameters, deploy on build, web publish method, package as a single file. And I also have this one, run code analysis. First it was just a check box, run the code analysis, and
34:22
then underwater, it's called MSBuild with this parameter. If you now want to run code analysis, you just have to specify this parameter, and then it will run it automatically for you. And then you have the package location, and this one is maybe a special value.
34:42
This is the build.staging directory. So the dollar bracket open value, what's that? That's a variable that you can use within the build pipeline. So let us move to the variables tab. If I look at the variables, first start with the
35:02
predefined variables. There are lots of them that you can just use in your build pipeline. So for example, the build directory, the home directory, what's the name of the agent that I'm running on, what's the path of my artifact location, what's the path of my source location, what's the path of my boundary
35:21
location, et cetera, et cetera. All those variables are present, and you can reference those variables in all the steps by just putting dollar sign bracket open, name of the variable, bracket close. And when running PowerShell, it just injects them as environment variables, and you can refer to them by
35:42
env colon, and then the name of the variable. So that's really useful. You have all those variables always at your servers. So you can also, of course, create your own variables. So just add a new one, give it a name,
36:03
and give it a value. For example, password. Let me do that. If I want to do a password, I can just type it in, but I want to encrypt this. So there is also this almost hidden path log that you can
36:20
press, and then it will just hide the value from the screen. That's great at first, but it will also encrypt the value in the database in VSTS, and it will not show in the output logs of your build. Then you're safe. If I now want to change this, if I save this and I want to change it back, it's never visible again.
36:41
So I always have to fill it in again. So that is great. So I will just put this back. Then walking through the other stuff, I can run multiple configurations at the same time. For example, I want to do a release and a debug for
37:00
different platforms. So I can add multipliers here. For example, do the build configuration in debug and release, or any CPU on debug and release, X64 on debug and release. So you can add multipliers by using this format. So build platform, build configuration, and then it will just do all those builds together.
37:22
You need multiple agents to do that, of course, because an agent can only run one build at the same time. So if you want to run in parallel, and that's an option that you can specify here. If you want to run in parallel, you need multiple agents available to run in, of course. Then there is the create work item on failure.
37:43
I think it's obvious. It will just create a bug when the build fills. And this one is very interesting. I also wrote a blog post on that, on road to ALM. This one is giving me an access token. So if I check this box, it will create automatically underwater a variable that's called system.accessToken.
38:00
And that access token can be used to access the REST APIs of VSTS. So if I want to do, for example, give me all the commits that are attached to the build I'm running now, because I want to do extra stuff on them, you can call the REST APIs of VSTS. But in order to be able to call the REST APIs of VSTS, you need to authenticate against the REST APIs.
38:23
And because the build agents are just running on a machine and you don't know what, you need to log in to that REST API. So if you press this button, it will provide me a token that has all the authentication details. And I can just access the REST APIs by putting that token in the headers of my request.
38:41
And I can just get everything from the REST APIs. So that's very convenient. Otherwise, you have to write your own authentication stuffy inside your PowerShell. And now you can just use this. So this is really, really useful. And if you want to use it, look into that. Then the repository.
39:01
So that's nothing special, again. So we can just change the repository where we are getting the sources from. And we have, of course, the triggers, the continuous integration trigger. It's just a check box. So every time when I check in into the repository that is attached to this build, so in my case, the Git repository, and it listens to the branch.
39:21
So if something changes on this branch, this build will trigger, and it will automatically run. And you can, of course, have scheduled builds at the same time. And that's something that is also new and opposite to the XAML builds. The XAML builds could only do one thing at the same time. So you could either do a continuous integration build,
39:40
and then you had to copy a build and do a scheduled build. And if you want to run two times a day, you had to copy the build again. And then you can do another schedule. Now that is all different, because we can just do everything at the same time. And we can add multiple schedules if we like. So this is really handy to do just your build configuration.
40:01
So let me just switch this off. What more about the general tab? Nothing more that you can change the build format, the build number format, and the retention policies that you have. So how long do I want to keep those builds? And nothing very, very convenient.
40:23
History audit logs on the build definition. So I can perfectly see who changed the build definitions and why. So that's also very nice. So when I run this build, and I'm not going to do it because my time is going really, really fast, but I
40:43
also prepared something like this. When I run this build, and this one is a little bit more verbose, maybe. So you can see all those things. So I run unit tests. So I can see my test results directly in my build report. I can see the code coverage.
41:02
So that's also directly in the build report for the unit test that I'm running. I can add tags. So this is a really convenient way to set, for example, your build quality. This build is ready for test, or this build is ready for release, or whatever. And you can see the associated changes.
41:21
So this build is, this commit is attached to this build. And if there are work items attached to that commit, they also show up here in the associated work items. What I really like about when a build, for example, failed, is that you can also see the field tests. And then the detailed report of the tests, they really,
41:42
really show you nice information. So for example, this test, the validate shopping card, it failed. When I click it, I have my error message directly in the screen. I can see the stack trace. So this is really rich information on these build definitions that you can also later on pin on a
42:04
dashboard or whatever you want to do with it. So this is the new build that is going. It's still expanding. So they are really now building the widgets for the release, the widgets for the test, so you can have a very, very rich build report.
42:21
So that's great. So let's move on to release. The release is actually not very exciting after I told you all this stuff about build, because it runs on the exact same infrastructure. There are two separate teams, and there are differences,
42:43
because that's how it works at Microsoft. They talk to each other, but they also have their own implementation of stuff. So there are tiny differences. For example, the rename, I have to do the rename here. And on the build, I have to right-click it and rename. So that's all the tiny stuff that frustrates me.
43:02
But OK, it still works. So those are the tiniest things. But the big picture, it's all the same. So we have the new release definition, and we have the tasks here. And when you create a task, you can say it's available in build, or it's available in release, or in both. And I think that 95% of the tasks that are in the
43:23
store right now are available on both. So if you look at this task, it's all the same. So you can just do the PowerShell, you can do deployments, you can run whatever you want, copy files, doing Azure stuff, creating resource groups on Azure.
43:42
It's all there. So this one, for example, the Azure Research Group Deployment, it's a really powerful task. You can just edit, and then you can say, OK, I want to point to a subscription that you can manage by creating an endpoint, and then you can just point to a resource group and say, start all the virtual machines, or stop all
44:02
virtual machines, or create me a new resource group based on this template. And it's just there, and it works on the water with the PowerShell stuff. An extra dimension that we have within my release pipeline is the environment. And I think, personally, that environment is a wrong term
44:23
that they use inside the release definition. Because for me, environment implies that it's a bunch of machines that it's running on. And maybe it is, but actually it's more like a stage. It's something that I do in a specific stage of my pipeline.
44:42
So in this case, when I go to the development stage, I want to deploy to this environment. And this environment is multiple servers. But when I've done that, I want to maybe move to the next stage where I do some copying of files and creating a zip file and maybe sending out some email or whatever.
45:01
And that's not an environment. It's just a stage that I'm going through in my pipeline. So environment is something, is a group of tasks that you want to execute. And you can put validation and approval on that specific stage. So keep that in mind that it's not related to machines.
45:22
It's more like the phase that you are going through. So I created four environments, development environment, QA, staging, and pre-production. And every environment has its own pipeline of steps. And luckily for us, you can clone those environments.
45:41
So if I have similar ways of doing stuff on the dev, it's doing exactly the same thing as on acceptance. Only there are different values of the parameters. I can just clone the environments, and I have it directly. So that's all there. So in my dev environment, I just now do a website deployment.
46:00
It's not really interesting because it takes the website that I created in my build, and it deploys that to a web application on Azure. How does it know to which build definition it should respond? When I create a new one, it asks me.
46:22
But if I already created one, I can go to the artifact step. And artifacts are something that you really should keep in mind. Microsoft really split it, the responsibilities of build and release. Where maybe Jenkins, who uses Jenkins?
46:41
OK, so there is no relation there. But I think it's a nice story to know because Jenkins is a task runner. It's a build system, or it's a task runner. And in Jenkins, you can do everything. You can just schedule a job, and it just runs the job. And sometimes it builds, and sometimes it deploys,
47:00
and sometimes it does something else. It doesn't really matter. Here, in VSTS, they really made the responsibility of, OK, we have a build, and the build outputs an artifact, a package, a zip file, or an MSI. And the release takes that artifact
47:21
and does do something with that. So deploy it to an environment, or copy it to some machine, or whatever. And that's something that you should really know. So you can do it probably, but you always need to build to have the artifacts, and then the release pipeline takes care of the rest.
47:42
So in my case, I linked the release build to this release pipeline. And I can link multiple builds. So if I have 20 components, then I have maybe 20 builds. They all output an MSI. And then I have one release pipeline, and I attach all those MSI as an artifact to my release.
48:03
And then I execute my deployments. So I attached this release build. So in my task, it asks me for the web deploy package. When I browse for this web deploy package,
48:23
it shows me the linked artifacts. So this is something that I delivered inside my build. These are the artifacts of my build that I published, and I can point to watch them. So this is just selected. There are other artifact stores, so I can point to a build.
48:44
I can point to a Git repository. I can even point to Jenkins. So if I have a Jenkins server that is publicly available, so where I can get to, I can create a service and point to that Jenkins server, and I can get my artifacts from there. So then I can use release management without the builds in VSTS.
49:03
So that is also very great if you're in transitioning, because you eventually are going to move over to this one. And then we have the variables, same as in the build. You can refer them as the same as the build. There are some other predefined variables that you can use,
49:21
the release.artifact directory and such thing. There is one catch here, a really, really bad UI. This release variables, it's actually a link. If I can click it, I can just switch to environment, and then I can see all my variables per environment.
49:41
So this is also nice. Triggers, I can create a trigger manual. I can create a release manually, so I can start a release. I can also do continuous deployment. When my build finishes that is attached to this release, it automatically starts this release. So this is continuous deployment.
50:01
And I can do scheduled releases as well. So I want to do the release every night at 3 o'clock, for example. And this one is also very interesting. This is quite new. These are environment triggers. So when are we going to trigger this release or this environment? So this dev environment, this one
50:22
will trigger after release creation. So my deployment condition is after release creation. So when I press new release, it will start automatically executing the development environment. When I go to the, for example, QA environment,
50:44
this one will trigger after another environment has finished, or it will trigger manually, for example. So this way, I can also do parallel stuff, because my QA environment says, OK, I
51:00
want to trigger when the dev environment is ready. But on my staging environment, I also say when dev environment is ready, I want to trigger this. So this way, you can just parallel deploy to multiple environments. And then you can come back, because on my production
51:21
environment, it says, OK, you have to wait until QA and staging are ready, and then publish to my production environment. So you can really create a nice flow of how your application moves through your infrastructure.
51:41
So that is very nice to see. And on the general tab, we have just some simple stuff on how does the release number look like. And we also have a history trail here. Creating a release is quite easy.
52:01
You can just create a release. You point to the build that you want to release, in this case. And then you just start running the release by create, and then it will automatically run. There is one thing that I missed, and that's, I think, the main advantage of using a release
52:21
pipeline like this. We can add validation. So what we can do is we can assign approvers to a specific stage. So whereas a build just runs when you trigger it, in the release pipeline, it's different. We can say this stage must be approved by someone, by me.
52:47
So before you do something, I want to send an email to this guy, and he has to approve that it's possible. So the first stage is most of the time not an approved stage. But the second stage, going to test, sometimes
53:02
a product owner wants to say, OK, I want to do it. Or the testers say, OK, I want to do it now. And they can just approve the build. And you can pre-approve and post-approve. So when it's there, you can also say, OK, it's OK now. So in this case, we have an approval. So when I start this release, and I point to this build,
53:26
and I say Create, it will not start automatically. But it has this little guy. And here it says, OK, you have to approve this specific release. And now it's waiting until the approval comes.
53:44
So I will not run it, because I want to show you the last demo of the extensions. And I think that's cooler than looking at the output of a release that's just executing some scripts. So going back to build, because I showed you the builds.
54:06
And I showed you how to add build steps. But I didn't show you that you have more build steps available than what's here. If you close this one out and you go to the shopping basket,
54:20
you can browse the Marketplace. And the Marketplace already contains a lot of build tasks that you can just click and install. If you do it, it will be available in your toolbox. And you can just add them to your pipeline.
54:42
And there are already great extensions available. And they are really pushing the community to build them. So it will grow and grow. And you can also build them yourself. And that's what I quickly wanted to show you now. So what I did is I created a small build task.
55:03
So this is my Git repo for that. And as you can see, it's very, very easy to do it. Because there is only an extension, a VSS extension manifest, which is just a description of this task. What's the version? What's the description? How does my Read Me page look like?
55:20
What are the background colors in the Marketplace? All that kind of configuration. Some licensing and overview, that's some documentation. Some images, also not really relevant. We have a task manifest, which describes the task. What is the version of the task? And which PowerShell does it execute?
55:41
On which agent should it run the minimum agent version? The demands. So if I need cURL, or if I need Java, I can add it to my task manifest so that I can demand it from my build pipeline. And you can see that it writes the message here. And then we have, of course, the PowerShell script itself, which just simply, in this case, writes a message.
56:03
So that's it. Then we have a TFX command line, which you can use. And with the TFX command line, you can package this directory into a VSIX. And at VSIX, you can upload to the Marketplace, where you have to be a publisher. So for that, I can show you the Marketplace,
56:24
because I have some issues with my account. I need another browser for it. Don't ask. It's Microsoft identities. That's really failing me sometimes. So I have to click the work account.
56:44
This is all the stuff that I already prepared. It's on my laptop. So I don't have to sign in and stuff. So this is the Marketplace. I have created one task.
57:01
That's available in the Marketplace already. So that's sending email. And you can see that there is only one task. So this is publicly available. The other task that I created is really private available. Instead of running the command line, what I did is I created a build and used a task from a colleague of mine
57:23
that just handles all the publishing stuff. So it replaces some variables. It replaces my version. It replaces the publisher. It replaces the public-private availability. It takes care of all kinds of stuff. So I use that task. And it just says, OK, take this Git repo,
57:42
package it into a VSIX, and upload it to the Marketplace. So when I run this build, it will hopefully do that. No, it's running on the Docker agent. That's not nice. So let's try that again.
58:09
So it's now running on my machine because it needs TFX. And it has some demands that are not handled correctly, probably. So that's feedback that I'm going to give him.
58:21
Take care of your demands. So it's now publishing to the Marketplace, setting the version. So when I refresh this, I have this write message task
58:43
available in my Marketplace. And it's shared with one account. In my case, my own account. So moving to a build that I already prepared for this, the write message demo, I can now go to Manage Extensions.
59:03
And then this write message task that I created with this nice NDC Oslo logo, I can click it. And I can install it into my account. So I will just hit and continue. So it's now installing.
59:22
And then it says, proceed to account. So it might be possible that I have to restart my browser because there is sometimes a little lag in the tasks. But hopefully it will do. So if I now edit my build definition.
59:41
OK, I already added it. So it was disappeared because I removed it. But in my toolbox on utility, there is this write message task that I created. That's only available on this account because it's private and shared with this account. And I can share with multiple.
01:00:00
accounts if I like. So during development, it's nice to have that for your own organization, or only keep it for your own organization, because you don't have to make it public. Then it's for everybody, and sometimes you have specific stuff that you want to run for your organization. So I created this message, and I already put in a
01:00:21
variable for that message, and then I can queue the build. That's the last step of my presentation. So before I do that, I want to tell you that I'm available today on the conference. So if you have any questions, if you want to see more, just find me, and I can show you everything that you like.
01:00:42
I hope that you enjoyed the session. Excuse me for that it was a little bit of noisy in the beginning, but you can imagine the stress that I had for the laptop stuff. So thank you for your patience. Thanks for being here. And now I'm going to run this build. And hopefully it will just start, and show some nice
01:01:05
output that I created for you. So to clone my repository, find a decent internet connection when you're doing VSTS.
01:01:22
So that's it. Thank you very much.