Domanda

My task is:

after TFS build

1) On a server X stop file Example.exe

2) Copy files from Drop Location into server X

3) Run a brand-new version of Example.exe on a server X

I'm updating DefaultTemplate.xaml in TFS 2012, Visual Studio 2012. I'm entering InvokeProcess activity that runs Do.bat script.

My Build Agent copies files to server X and then runs file \X...\Do.bat

Do.bat is something like

taskkill /F /IM Example.exe
start \\%~p0Example.exe

So, the problem is the Example.exe is running on a Build Agent, not on server X.

How can I make build agent run an executable file on another server? The additional question - is it worth using bat files as scripts in TFS Build?

È stato utile?

Soluzione

PsExec is a SysInternals tool that will run a process on a remote computer.

PowerShell is also able to launch a process remotely.

As to your additional question, I have generally found it more worthwhile customizing my tfs builds writing build activities in C# and/or using the built-in activities and customizing the build template in xaml. Not fun, but I find external scripts run into more permissions issues and are difficult to debug. I've tried them, and then I usually end up back in C#.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top