简体   繁体   English

TFS 2015 vNext Build-通过脚本获取特定源

[英]TFS 2015 vNext Build - Get specific sources through script

we are running TFS 2015 Update 3 on premise. 我们正在内部运行TFS 2015 Update 3。

We have a build definition that picks up the latest successful drop from the Gated checkin build to run tests. 我们有一个构建定义,该定义可以从Gated检入构建中获取最新成功的降级以运行测试。 For theses tests we also need the source code of the same checkin. 对于这些测试,我们还需要相同签入的源代码。 If we queue a new build it will get the latest sources, but its possible that these sources are of a different changeset than the last successful drop. 如果我们对一个新的构建进行排队,它将获得最新的资源,但是这些资源与上一次成功删除相比可能具有不同的变更集。 Mainly because it can take about 2 minutes before the sources are pulled, if by then a new gated checkin has been completed, the task after the get will get a newer version of the drop than the sources that have been pulled. 主要是因为拉出源大约需要2分钟,如果到那时新的选通检入已完成,则get之后的任务将获得比拉出的源新版本的drop。

Is there a way we can have the build run a script first, say the script that looks for the latest successful build. 有没有一种方法可以让构建首先运行一个脚本,比如说寻找最新成功构建的脚本。 Then use the changeset number from that build to do the Get Sources of that specific changeset? 然后使用该构建中的变更集编号执行该特定变更集的获取源?

We can not prevent the Get source step getting the latest sources, we can only add a Command Line/Batch script or PowerShell step to run script to get the specific changeset version sources. 我们不能阻止“获取源代码”步骤获取最新资源,我们只能添加“命令行/批处理”脚本或PowerShell步骤来运行脚本以获取特定的变更集版本源。 Then copy the specific source to build. 然后复制要构建的特定源。

In you scenario, I think it doesn't make sense, as mentioned above, we cannot make sure the changeset number with the latest successful build is the exact changeset your want to get. 在您的情况下,我认为这没有任何意义,如上所述,我们无法确定具有最新成功构建的变更集编号是否是您想要获得的确切变更集。

Seems the only way is build manually, specific the changeset to build. 似乎唯一的方法是手动构建,具体要构建的变更集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM