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 摘要。