Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a new pipeline from existing YML file in the repository (Azure Pipelines)

Usually, I create a new build pipeline via the Azure DevOps portal. Then, the editor will take me through the steps of choosing the project source, repository, and template. After that, I will have an option to create a new branch or commit directly to the master branch.

However, this time, I have an existing azure-pipelines.yml file in my branch. I created it with a text editor locally and push this branch to Azure DevOps. I want to attach this file and let Azure Pipelines create and queue a new build. But I can't find any option. The importing build pipeline option only accepts JSON files.

Is it possible to create a new build pipeline from an existing YML file in the repository?

I know I can use the classic editor, which has a step to specify a YML file. But I prefer an option that I can use the YML editor with Task Assistant on the Azure DevOps portal.

Thank you all.

like image 333
Lam Le Avatar asked Nov 27 '19 09:11

Lam Le


People also ask

How do you clone a YAML pipeline Azure DevOps?

Navigate to the pipeline details page for your pipeline. Choose ... and select Clone. Your pipeline is cloned with -clone appended to the name. Choose Save or Save & queue to save the cloned pipeline.

How do you edit the existing pipeline in Azure DevOps?

Sign in to your organization ( https://dev.azure.com/{yourorganization} ). Select your project, choose Pipelines > Pipelines, and then select the pipeline you want to edit. Choose Edit. Make edits to your pipeline using Intellisense keyboard shortcuts and the task assistant for guidance.

How do I create a new pipeline in Azure DevOps?

Sign-in to your Azure DevOps organization and go to your project. Go to Pipelines, and then select New pipeline. Do the steps of the wizard by first selecting GitHub as the location of your source code. You might be redirected to GitHub to sign in.

How do I create multiple Pipelines in Azure?

Sign in to your Azure DevOps organization and navigate to your project. In your project, go to the Pipelines page, and then select New pipeline. Select GitHub as the location of your source code. For Repository, select Authorize and then Authorize with OAuth.


2 Answers

If you pushed azure-pipelines.yml to a new branch, Azure DevOps detect it automatically, if you have a CI trigger you will see a build start to running.

You can create a new pipeline and specify an existing YAML file:

enter image description here -> Choose you repository.

enter image description here

enter image description here

You can also can go the repo build page (if you already have a build for this repo with other branch) and click Run pipeline and there choose the branch:

enter image description here

enter image description here

like image 108
Shayki Abramczyk Avatar answered Oct 05 '22 13:10

Shayki Abramczyk


I found that the easiest method is to navigate to the Repos section, select the repository and click on the Set up Build button there.

Set up Build

You can then select Existing Azure Pipelines YAML file from the options.

like image 35
Mobiletainment Avatar answered Oct 05 '22 15:10

Mobiletainment