0

I've configured a build that has no problem copying its outputs to a clean VM. Now I want to define a post-build event that invokes the installer on the drop machine. No luck as yet. The event looks like this:

$(DropLocation)\$(BuildNumber)\Submittal\$(IntfGenericName)_$(BuildNumber)$(BuildLabel).msi /qn

...and correctly specifies the name of the installer. I tried a simple command:

  ($DropLocation)echo "HI" >tmp.txt

...which doesn't work either. Is it perhaps not possible to issue commands on the drop machine?

Dylan Smith
  • 22,069
  • 2
  • 47
  • 62
batchman
  • 31
  • 4

2 Answers2

3

Configure the machine as a TFS Lab Environment (in MTM / Lab Center). Then create a TFS Build using the LabDefaultTemplate. The Lab Default Template is specifically designed to grab the drop from another build, copy it to a target environment, then execute commands on that environment (and optionally run some tests).

Dylan Smith
  • 22,069
  • 2
  • 47
  • 62
0

I think DylanSmith's answer is probably the way to go but you can also use an Exec task thus:

<Exec WorkingDirectory="$(DropLocation)" Command='echo "HI" >tmp.txt' ContinueOnError="false" />.

I use these in msbuild files I add, which run after my solution's built so I don't have to modify my xaml, modifying the xaml is the usual thing to do though I believe.

timB33
  • 1,977
  • 16
  • 33
  • An exec task will run on the build server not the drop server. – Dylan Smith Mar 21 '14 at 12:07
  • yup, you're right. the example above was a bit too contrived. What I have done is use the exec task to copy linux code from a TFS build server to a Linux host where I've then kicked off a compile by using Plink inside the exec task. It's something like that which is an option for batchman, using psexec or powershell instead of plink to kick off the install. It's an awkward solution though. – timB33 Mar 21 '14 at 14:24