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