Question

Problem I have a build definition existing in TFS (which i cannot change). I am automating our File gathering process, in which i need to execute this build definition, get the drop location and copy those output to desired location.

Solution: We already have a batch file which does file copy operations. So i am trying to integrate everything in it. I started the build using TFSBuild.exe (Command line tool). Provided server path, build definition name. Build completed successfully.

My problem is i am not able to get the name of the folder (or any build completion details) where the currently executed build definition has dropped the output to append to drop location. I want to fetch the value of Drop folder after build completion.

(If there is any better/simpler method, it would be helpful)

Thanks in advance.

Was it helpful?

Solution 3

Looking at all the inputs and comments over the internet, there seems to be no way to extract the Updated Build number/name/ drop folder name from TFSBuild.exe.

So, i have managed a Workaorund. (Bit tedious, but works)

Push all the output of TFSBuild.exe command to a txt file.

TFSBuild.exe start "TFS Server Path" >> "SOME TXT FILE"

Parse the txt file and extract the line containing value "Updated Build number:" and get the output folder name.

As i know the Drop location where all the builds are dropped, append the foldername and get the files.

OTHER TIPS

You can specify the droplocation as a part of queuing the build using TFSBuild.exe. "TFSBuild.exe help start" on the command line should help you with that.

On a side note, if you are still using batch file to copy files from drop location to somewhere else for packaging then the process is not automated at all in my opinion. Customize your build process, use WIX to package the code. Right after the source code compilation is over you can kick off the WIX package and the final output of your build would be an MSI for deployment!

If at all I have understood your problem, $env:BUILD_ARTIFACTSTAGINGDIRECTORY should help you! Thanks for posting this question!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top