Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

tfsbuild - TFS 2015 - Delete Build Artifacts

How to step up TFS 2015 Update 2 to delete artifacts when build is deleted?

Is this possible?

enter image description here

EDIT: Add retention screen shot

I am using the default retention policy but it is NOT deleting artifacts from the drive.

enter image description here

EDIT: Add Copy and Publish Build Artifacts

enter image description here

EDIT: Add Working Folder

I added a powershell to display all environment variables and it said my workingFolder = E:TfsBuildsAgent1_WorkPlace5s

Do you a powershell to set workingFolder to default?

Here is the file structure i have:

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

enter image description here


Update3

Each agent will have their own work folder. Such as XXXAgent1, XXXAgent2,...XXXAgent6. 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 XXXuilds. 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. enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...