如何从 Azure DevOps 中的构建管道创建更改集以将某些文件推送到我的存储库中

穆基姆·艾哈迈德

我在 azure DevOps 上的 TFS 服务器上有我的代码仓库。在这个应用程序的 CI 部分,我执行了一些操作,在生成一个文件之后,假设它是某种日志文件或从存储库中现有版本创建的报告,但现在我想重新签入我的代码来自构建管道的回购。那么什么是最好的解决方案呢?

Cece Dong - MSFT

如果您使用 TFVC 版本控制,您可以调用 REST API Changesets - Create in a powershell 任务或 TF Command Checkin 命令在流水线中的命令行任务中创建新的变更集。

POST https://dev.azure.com/{organization}/{project}/_apis/tfvc/changesets?api-version=5.0

tf checkin [/author:author name] [/comment:("comment"|@comment file)] 
[/noprompt] [/notes:("Note Name"="note text"|@notefile)] 
[/override:(reason|@reasonfile)] [/recursive] [/saved] [/validate] [itemspec] [/bypass] [/force] [/noautoresolve]  [/login:username,[password]] [/new]

如果您使用 Git 版本控制,您可以调用 REST API Pushes - Create将更改推送到存储库。

POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes?api-version=5.0

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在Azure Devops构建管道中绕过UWP App认证?

如何使Azure DevOps存储库中的文件可公开访问?

如何使用Azure CLI创建Azure DevOps存储库

如何在Azure Devops中为多模块Maven创建构建管道

如何在Azure DevOps中删除TFVC存储库?

如何在Azure DevOps中删除Git存储库?

Azure DevOps(VSTS)-如何将文件从代理VM复制到我的仓库中

如何为Azure Devops构建管道编辑Yaml路径?

如何在Azure DevOps管道中管理构建工件?

Azure DevOps-如何使用多个存储库创建构建管道?

如何解决:尽管在构建管道中设置了变量,但在Azure Devops中连接字符串为null

如何使用NodeJS中的azure-devops-node-api库将文件推送到TFS?

在Azure DevOps构建管道中还原Libman JS库

Azure DevOps:如何从发布管道中的PowerShell脚本从构建Azure管道中检索构建工件?

如何知道Azure DevOps构建管道中的上一步结果?

如何使用Azure DevOps REST API创建新的构建管道?

如何在Azure DevOps中创建板?

我们如何在Azure DevOps构建管道中读取GIT提交消息?

如何在Azure DevOps中获取所有存储库

如何在 Azure DevOps 构建期间使用 PowerShell 脚本将构建工件推送到 Git 存储库?

Azure DevOps 使用 GitHub 中的存储库构建管道

Azure DevOps 构建管道:如何仅为更改的程序集增加程序集版本?

如何在 azure Devops 中创建 2 个构建管道之间的依赖关系并将工作项链接到构建管道?

如何在 Azure DevOps 中覆盖“拒绝”存储库权限?

如何在 azure devops 管道中使用来自 azure devops 存储库的共享文件

如何在 Azure DevOps 的构建管道中启用 Ouath 身份验证

如何在 Azure DevOps 中复制文件?

在 Azure DevOps 构建管道期间创建 json 文件

Azure DevOps 多级管道 YAML:如何检出多个存储库?