How to identify files that have changed during TFS Build 2015

孤者浪人 提交于 2019-12-12 17:08:00

问题


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.

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?

thx


回答1:


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 can accomodate the first (diff) portion of your scenario: https://msdn.microsoft.com/en-us/library/bb385992(v=vs.140).aspx

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

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

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

Expand output of TF.exe results from PowerShell

External:

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




回答2:


I would recommend that you deploy the entire application on each deployment, however there are actions that you can take too minimise the time taken to run the deploy.

If you are deploying SQL then consider using a folder with numbered scripted and record the last run number in the database. There are tools like ReadyRoll and SSW SQL Deploy that can help automate this, but ultimately this is easily solved.

For asset files like images and other binaries you will need to do a date stamp compare.



来源:https://stackoverflow.com/questions/35730175/how-to-identify-files-that-have-changed-during-tfs-build-2015

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!