Last active
July 15, 2019 23:46
-
-
Save goyalmohit/dd13cb229a59aeca22710ebd973c24ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Parse output from az pipelines runs list command into a nice format using python | |
Below code assumes that output from 'az pipelines runs list' command has been stored | |
under the az-pipelines-runs-list.json file. | |
""" | |
import json, sys | |
with open("az-pipelines-runs-list.json", "r") as f: | |
runs = json.load(f) | |
print(f"ProjectName \t PipelineName \t BuildNumber \t FinishedAt \t Result") | |
for item in runs: | |
project_name = item['project']['name'] | |
pipeline_name = item['definition']['name'] | |
build_number = item['buildNumber'] | |
finish_time = item['finishTime'] | |
result = item['result'] | |
print(f"{project_name} \t {pipeline_name} \t {build_number} \t {finish_time} \t {result}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment