We have TFS 2017 and we using TFVC.
We have vNext build definition with many source code mapping from many branches (all the code is required for the build).
At the end of the build (if he passed successfully) I want to take all the local code from the agent folder (with the local folder structure) and check-in all the code to separate branch ("release branch" for example) and keep the folders structure.
(We want one branch with all the "working" code, in the development, we can't work with one branch, because the build required many different sources).
I thought about something like this:
- Create a new folder
- Create a new workspace in this folder
- Mapping the folder to "release branch"
- Copy all the code to this folder
- Check in the files to the branch
One thing to consider: we have many builds definitions and we want to do it for all, so for each build, we want to create a folder on the "release branch" and check in the code to there. so I need to check if the folder exist, if yes - check in, is not - create a folder and check in.
How can I do that? (tf.exe?)
UPDATE:
I succeed with tf.exe
tool to achieve that unless one issue:
tf.exe
can't detect automatically deleted files, I need to specify which items are deleted from the workspace. how can I do that? (I have a folder with hundreds of folders and subfolders)