2
votes

I need to check-in some files generated during a TFS 2017 vNext build. In my old XAML build I could easily do that using the tf checkin command since the files reside in the build workspace.

In the new vNext build, The workspace owner is Project Build Service or Project Collection Build Service, even when I configure the agent to run under a different account. Any way to perform the check-in on the build workspace? Or somehow configure who owns that workspace?

2
That shouldn't be an issue. I'm using a PowerShell script to perform my check-ins, and tf.exe works just fine. You might check the workspace, though - it's now "\src", where before it was "\source".Jim Roth
It is not a good practice to check-in generated files. They should be part of your build output for posterity, but have no place in Source control.MrHinsh - Martin Hinshelwood

2 Answers

1
votes

There are Add and Check in changes tasks in TFVC Build Tasks extension.

Regarding no pending changes, you need to add the files to the list of pending changes for the workspace by calling TF add command.

0
votes

It's not a recommend way to check-in/ modify source code during a build pipeline. If you really want to do this, you could edit the build worspace files and use tf commands in custom/powershell task eq:

cd $env:BUILD_SOURCESDIRECTORY

$TFFile = Get-Item "C:\Program Files (x86)\Microsoft Visual Studio 1x.0\Common7\IDE\TF.exe"

$tfOutput = [string]( & $TFFile.FullName checkin /noprompt /override:"***NO_CI*** New version is $newVersion." /comment:"***NO_CI*** New version is $newVersion." 2>&1)

Another way is installing TFS Power Tool and use the Windows PowerShell Cmdlets to check in the files. Refer to this link for more details: PowerShell and TFS: The Basics and Beyond