Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to validate an Azure DevOps Pipeline locally?

When making changes to YAML-defined Azure DevOps Pipelines, it can be quite tedious to push changes to a branch just to see the build fail with a parsing error (valid YAML, but invalid pipeline definition) and then try to trial-and-error fix the problem.

It would be nice if the feedback loop could be made shorter, by analyzing and validating the pipeline definition locally; basically a linter with knowledge about the various resources etc that can be defined in an Azure pipline. However, I haven't been able to find any tool that does this.

Is there such a tool somewhere?

like image 210
Tomas Aschan Avatar asked Oct 29 '18 08:10

Tomas Aschan


People also ask

How do I validate Azure pipeline?

From within a YAML file open the Command Palette (Ctrl+Shift+P) and select the 'Azure Pipelines YAML Validator: Validate' command, alternatively use the keyboard shortcuts Ctrl+Alt+V on Windows and Ctrl+Cmd+V on Mac. Your YAML file will then be validated and any problems reported.

How do I check the pipeline on Azure DevOps?

To view active release pipelines, select Pipelines > Releases. From there, you can drill into the details of a release. For example, here we show the Release-3 pipeline.

How do I run Azure pipeline unit test?

Run unit tests locally and then in Azure Pipelines. Add dashboard widgets to visualize test runs over time. Perform code coverage testing to see how much of your code is covered by unit tests. Fix and verify test failures in your build pipeline.

Is Azure DevOps being discontinued?

Azure DevOps (ADO) is not going away anytime soon and will get plenty of love. It is one of the undervalued things about Microsoft – its long-term commitment to the lifecycle of its software and providing new features and support for its customers.


1 Answers

UPDATE: This functionality was removed in Issue #2479 in Oct, 2019


You can run the Azure DevOps agent locally with its YAML testing feature.

  1. From the microsoft/azure-pipelines-agent project, to install an agent on your local machine.
  2. Then use the docs page on Run local (internal only) to access the feature that is available within the agent.

This should get you very close to the type of feedback you would expect.

like image 52
Jamie Avatar answered Sep 21 '22 18:09

Jamie