TFS 2017 - 如何构建/交付仅更改的文件? [英] TFS 2017 - how build/deliver only changed files?

查看:29
本文介绍了TFS 2017 - 如何构建/交付仅更改的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 TFS 2017,关于标题,我找到了一个术语:增量构建 - 但是,我找不到设置它的位置.我试图在构建参数"(/p:IncrementalBuild=true)中添加增量参数,但总是出现错误,表明这是错误的参数.是否可以仅交付(或构建和交付)更改过的文件?

I'm using TFS 2017, and regarding to title I found a term: Incremental build - but, I can not find out where to set it. I tried to add Incremental parameter in ' build parameters' (/p:IncrementalBuild=true) but always got error which says that this is wrong parameter. Is possible to deliver (or build and deliver) only changed files?

推荐答案

让我们假设我是如何解决这个问题的(如果有人有类似的问题):

Lets assume how I solved this problem (if anyone has similar problem):

由于TFS 2017总是交付所有文件-更改和未更改,但我只需要更改,我解决了以下问题:

Since TFS 2017 always delivered all files - changed and unchanged, but I need only changed, I solved this as follows:

由于传输到 Artifact 的文件保留时间戳(未更改的文件具有 last_edited 时间戳,而编辑过的文件具有新的当前时间戳),因此我决定创建 FIXED Artifact 目录(不取决于构建版本,但始终相同).然后我编写了 PowerShell 脚本(作为第一个发布步骤),它删除所有时间戳为 < 的文件(递归).(现在 - x min),以及之后的所有空目录.通过这种方式,Artifact 目录只包含已更改的文件(保留整个文件结构(已更改的文件)).现在发布将仅将这些文件传送到目的地.

Since files that are transferred to Artifact keep timestamp (unchanged files have last_edited timestamp, and edited files have new, current timestamp) I decide to create FIXED Artifact directory (not depending on build version, but always the same). Then I wrote PowerShell script (as a first Release step ) which deletes all files (recursive) which have timestamp that is < (Now - x min), and all empty directories after that. On this way Artifact directory contains of ONLY CHANGED files (entire file structure (of changed files) is kept). Now Release will deliver only these files to destination.

干杯!:)

这篇关于TFS 2017 - 如何构建/交付仅更改的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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