如何识别在 TFS Build 2015 期间发生更改的文件 [英] How to identify files that have changed during TFS Build 2015

查看:33
本文介绍了如何识别在 TFS Build 2015 期间发生更改的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将更改从一个分支合并到一个发布分支,并且只将这些更改的文件部署到生产环境.这些文件是 Maestro 和 SQL 文件,因此没有构建",只有需要移动的单个文件.这个过程完全是手动的,我想使用 TFS 2015 CI 构建和/或 Release Management vNext 2015 Update2 自动化这个过程.

I have a need to merge changes from one branch to a release branch and only deploy these changed files to a production environment. these files are Maestro and SQL files, so there is no "build", just individual files that need to be moved. this process is all manual and I would like to automate this process using TFS 2015 CI builds and/or Release Management vNext 2015 Update2.

我的主要问题是如何识别已更改的文件.使用构建代理工作区并不可靠,因为在执行 getlatest 时设置了文件上的时间戳.

My main issue is how to identify the files changed. Using the build agent workspace is not reliable as the time stamps on the files is set when doing getlatest.

我认为识别更改文件的最可靠方法是查看合并变更集并获取该文件列表并编写自定义包的脚本以移至生产环境.

I believe the most reliable way of identifying changed files is by looking at the merge changeset and getting that list of files and scripting out a custom package to move to production.

有没有其他人解决过这个问题,如果有,你是怎么解决的?

Has anyone else solved this problem and if so how did you do it?

谢谢

推荐答案

人们不需要/不想使用文件日期戳来获取这种类型的信息,正如您所说的那样不可靠.

One would not need/want to use file datestamps to get this type of info, as you say it would be unreliable.

1.TF FolderDiff 可以容纳您场景​​的第一 (diff) 部分:https://msdn.microsoft.com/en-us/library/bb385992(v=vs.140).aspx

1. TF FolderDiff can accomodate the first (diff) portion of your scenario: https://msdn.microsoft.com/en-us/library/bb385992(v=vs.140).aspx

2.TF Merge 可以容纳您方案的第二(合并)部分.https://msdn.microsoft.com/en-us/library/bd6dxhfy.aspx

2. TF Merge can accomodate the second (merge) portion of your scenario. https://msdn.microsoft.com/en-us/library/bd6dxhfy.aspx

3. 可能需要将其包装在控制脚本(可能是 PowerShell)中并从构建过程中调用

3. It is likely that one would need to wrap this in a controlling script (PowerShell perhaps) and invoke from the build process

以下是在 PowerShell 中包装 TF 命令的一些一般示例:

Here are some general examples of wrapping TF commands in PowerShell:

从 PowerShell 扩展 TF.exe 结果的输出

外部:

http://www.tomsitpro.com/articles/how-to-commit-code-tfs-powershell,2-990.html

https://github.com/adbertram/Random-PowerShell-Work/blob/master/TFS/TFSClientFunctions.ps1

这篇关于如何识别在 TFS Build 2015 期间发生更改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆