From the course: Azure DevOps: Continuous Delivery with YAML Pipelines

Convert classic to YAML pipelines - Azure Tutorial

From the course: Azure DevOps: Continuous Delivery with YAML Pipelines

Start my 1-month free trial

Convert classic to YAML pipelines

- [Instructor] So let's take a look at what's involved in converting from a classic into a YAML pipeline. Here's our classic pipeline. Let's open it up and what we want to do is take a look at what these steps are. We have all these steps that are created here. If I click on the agent, I can see that there's a YAML button that comes up. If I click on that YAML button, then I can actually get a copy of what this YAML pipeline would look like. Each of the tasks are scripted in here. If I look at this there's a NuGet command that goes out and runs, so I can see the VS Build command. I can see the test commands. I can copy all of this to the clipboard and then work with it if I want to or I can just start fresh. So let's do that, but first before we do that I do want to make one minor change and that is I want to turn off the continuous integration. Reason is is that I don't necessarily want to run the old pipeline when I've got a new one that does the same thing, so what we're going to do is we're going to go ahead and turn that off and save it, and then let's go back to our pipelines, and we're going to leave this and go over here to the button that says New Pipeline. Here, I'm going to go out and I'm going to create a new pipeline. Let me just collapse this and give us a little bit more room. Now, I am running from the GitHub, which is the repo where I've got my code. This lets me go out and choose the repository I want to work with, which will be in this case My YAML, and then I can pick the type of pipeline I want to start with. In this case I'm going to use the ASP.net to go out and build a regular project. Now, we're going to call this our Azure pipeline, YAML and then you can see down here it's got a couple of tasks. You see that it's got some variables coming in for the solution name. I've got my build configuration. It goes out, does a NuGet installer and then does a build. There is some arguments that are on here. These build arguments are the same that were in our old pipeline, including publishing this out to a package location, the artifact staging directory. Now, we can come down here. We can save this and run it and it will go out and it'll create and save our project. Let's go ahead and before we save and run this, let's just go out and let's just save this, and then once we've saved it, then I'm gong to do one other thing and that is to rename this and in fact, we're going to use the same name as the file which is Azure Pipelines and we'll save that. Now, I'm saving it the same name as the file. Just makes it a little bit cleaner later on. We're going to go ahead and run this and you'll notice that we have the branch that it's running from. We've got our options for variables, stages, and resources. We'll look at that again later, but I'm going to click on run and now it's going to go out and it's going to take that same pipeline, the same set of tasks and it'll go out and cue it up and run it. Again, we can watch the pipeline as it runs by simply clicking on the job. It opens it up and we can speed this up so that you don't have to spend that much time watching it, but it takes about a minute and a half to complete. When it's complete, then we can to back and we can see that output. Click on the back button and you'll notice that it built successfully, but there's no artifacts. We do want to get artifacts, so let's talk about artifacts.

Contents