MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
444 stars 155 forks source link

Reading YAML-Pipelines #402

Open renekroll opened 3 years ago

renekroll commented 3 years ago

I would like to read YAML Pipelines via the module and it looks like that currently only the classic Build and Release Pipelines are supported.

I can find the YAML pipeline with:

$pipeline = Get-VSTeamBuildDefinition -ProjectName $ADOSProjectName -Id 1234

Asking for pipeline runs:

$pipelineRuns = Get-VSTeamBuild -Definitions $pipeline.id -ProjectName $ADOSProjectName 

When I explore the pipelineRuns result object I cannot find any information about the deployments to the environments in this pipeline.

Do you plan to add support for YAML Pipelines?

SebastianSchuetze commented 3 years ago

What do you mean by reading YAML pipelines? Getting the YAML itself or what would you like to see?

renekroll commented 3 years ago

You can define the complete release process in a YAML File. For Example Deployment to Dev -> Test -> Stag -> UAT.

Our release process is written in YAML and executed as a Azure Devops Pipeline. You can define Stages and deploy to a stage.

In the Azure Devops Services "Pipeline UI" a pipeline run looks like:

Yaml

I want to get the information if a deployment to stage was sucessfully or not.

EDIT: I checked the Azure Devops Services API and found that the required information comes from this "environment" endpoint.

env

Here is the Microsoft documentation for this endpoint. https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environmentdeployment%20records/list?view=azure-devops-rest-6.0

With this endpoint you can get a list of all available environments https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environments/list?view=azure-devops-rest-6.0

Is it possible to provide/implement Cmdlets to get inforamtion from this API endpoints?

SebastianSchuetze commented 3 years ago

@renekroll generally for sure. Two options. You try an implementation with same approach as any other cmdlet here and unit tests an with the PR we can polish and finish it.

Or you wait until we or somebody else is doing it. The latter one could take a while.