microsoft / microsoft/azure-devops-python-api

No documentation on how to trigger pipeline build on 'master' branch.

未關閉
#290 8 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
684
分支
218
平均合併
8 天 10 小時
30 天內合併 PR
1

描述

import os
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication

Fill in with your personal access token and org URL

PERSONAL_ACCESS_TOKEN = os.getenv("PERSONAL_ACCESS_TOKEN")
ORGANIZATION_URL = 'xxxxxx'
PROJECT_NAME = "xxxxxx"

def create_pipeline_client():
# Get connection from devOps & create pipeline client
credentials = BasicAuthentication('', PERSONAL_ACCESS_TOKEN)
connection = Connection(base_url=ORGANIZATION_URL, creds=credentials)
pipeline_client = pipeline_client = connection.clients_v5_1.get_pipelines_client()
return pipeline_client

def build_pipeline():
pipeline_client = create_pipeline_client()
run_params = {'sourceBranch' : "master"}
pipe_id = 2098
pipeline_client.run_pipeline(
run_parameters=run_params,
project=PROJECT_NAME,
pipeline_id=pipe_id,
pipeline_version=None)
print("Pipeline run successfully activated.")

build_pipeline()

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 issue 中的 Python 範例開始,找到 repository 現有的文件入口。使用所示的 Azure DevOps API 流程,記錄如何為 master 分支觸發 pipeline build;文件應說明所需的設定以及由此產生的 pipeline 執行。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, python
領域
api, devops, documentation
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。