TFS 2015 - 删除构建工件 [英] TFS 2015 - Delete Build Artifacts
问题描述
如何在删除构建时加强 TFS 2015 Update 2 以删除工件?
这可能吗?
添加保留屏幕截图
我正在使用默认保留策略,但它不会从驱动器中删除工件.
添加复制和发布构建工件
添加工作文件夹
我添加了一个 powershell 来显示所有环境变量,它说 my workingFolder = E:TfsBuilds\Agent1_WorkPlace\5\s
您是否拥有将workingFolder 设置为默认值的powershell?
这是我的文件结构:
如果您
<小时>更新 3
每个代理都有自己的工作文件夹.如XXX\Agent1、XXX\Agent2、...XXX\Agent6.我认为问题在于您混淆了文件结构.
使用您的文件结构,部署到服务器的文件将复制到名为 XXX\builds 的文件夹中.但是,这些文件不是已发布的工件.有类似临时文件的东西.如果你想自动删除构建下的文件,你可以添加一个
How to step up TFS 2015 Update 2 to delete artifacts when build is deleted?
Is this possible?
EDIT: Add retention screen shot
I am using the default retention policy but it is NOT deleting artifacts from the drive.
EDIT: Add Copy and Publish Build Artifacts
EDIT: Add Working Folder
I added a powershell to display all environment variables and it said my workingFolder = E:TfsBuilds\Agent1_WorkPlace\5\s
Do you a powershell to set workingFolder to default?
Here is the file structure i have:
If you specify build retention policies, retention policies will delete the items below:
- The build record
- Logs
- Published artifacts
- Automated test results
- Published artifacts
- Published symbols
More details you can refer a similar question in SO: Should artifacts associated with a build record be deleted when the build record is deleted?
Moreover, if you manually delete the build, everything of the build will be deleted.
Update
For now, server drops are deleted when a build is deleted but drops to UNC shares are not. It's also a known issue: Build.Preview - Drop Folder not deleted when build is deleted
If so, you may have to delete them manually.
Update2
I was wondering did you missed up the working folder with the drop folder. The default work folder location is a _work folder directly under the agent installation directory. The files in this folder will always keep or deleted until next build triggered. You can find the directory in your build log to double check this. More details please refer the definition from MSDN.
Update3
Each agent will have their own work folder. Such as XXX\Agent1, XXX\Agent2,...XXX\Agent6. I think the issue is that you are confusing the file structure.
With your file structure, the files which deployed to the server is copying to the folder called XXX\builds. However, these files are not the published Artifacts. There are something like temporary files. If you want to auto delete the files under the builds, you can add a Delete files task. at the last step. Even if these files are deleted during the build. You can still download the artifacts from server after build finished.
这篇关于TFS 2015 - 删除构建工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!