title: Copying files in Jenkins multi-configuration job
body: <p>I am setting up an environment to do some testing. Our build actually happens on our Team Foundation Server (TFS), which also spawns two Linux builds via SSH. The result of our build is 6 different configurations, including Windows and Linux both 32 and 64 bit (it's C++ code with a Python layer on top), and two Python versions. The output looks something like this:</p>
  
  <ul>
  <li>BuildXX 
  <ul>
  <li>foolnx26 </li>
  <li>foolnx26-64 </li>
  <li>foolnx27 </li>
  <li>foolnx27-64 </li>
  <li>foowin27</li>
  <li>foowin27-64 Tests</li>
  </ul></li>
  </ul>
  
  <p>On the test slaves, I would like it to look like this:</p>
  
  <ul>
  <li>$WORKSPACE
  <ul>
  <li>foo... (just one of these)</li>
  <li>Tests</li>
  </ul></li>
  </ul>
  
  <p>The Test folder contains a bunch of Python test scripts. For each platform, I want to copy the Tests folder and only the appropriate output folder for that platform. The output is pretty large so I want to avoid copying more than necessary. We want to run these tests on every checkin. I am not looking to change how we build the code, at least not yet, just looking to add some additional hardware testing. To cover all our testing needs, I need to run tests on Windows and Linux, both 32 and 64 bit, with combinations of other hardware our code interacts with.</p>
  
  <p>Basic requirements are:</p>
  
  <ul>
  <li>Need to run on various platforms. 
  <ul>
  <li>I am using a multi-configuration (Matrix) job for this, which works very well for routing the child jobs.</li>
  </ul></li>
  <li>Need to copy the output only for the specific platform to the slave.</li>
  <li>Files to copy will be on a Windows server. </li>
  <li>Slaves are both Windows and Linux</li>
  <li>Jenkins will be called from the TFS build when it succeeds (probably via Python actually)</li>
  <li>There is a new directory for each TFS build. I need to specify that directory as a parameter to Jenkins.</li>
  </ul>
  
  <p>I have tried several approaches, but none seem to do just what I need:</p>
  
  <ol>
  <li>File System SCM plugin.
  I can't find a way to use a parameter/variable for the source directory for this. Also, it doesn't seem to work for copying from Windows to Linux</li>
  <li>Copy To Slave plugin.
  This can copy the files, but not to where I want them. Even setting my own custom "Paths are relative to" value (which I didn't see documented, just stumbled on it), I still end up with extra subdirectories under the workspace folder. Using a matrix job, there's already a bunch of folders there. It's also a problem because I need to know where I am to set things like PYTHONPATH for my testing.</li>
  <li>Publish Over SSH plugin
  I spent a lot of time trying to figure this one out and just couldn't make it work. There is a lot of configuration involved, much more than I would like. It doesn't really seem to be design to manage pulling files from a server to a slave machine (it is a publisher...). I think I was looking at this a bit backwards, but can't figure out an easy way to make it do what I need.</li>
  </ol>
  
  <p>At this point, I am probably just going to write shell script code to call rsync to move the files, similar to how I fire the Linux builds from our TFS build. It just seems like I shouldn't have to do this. All I want is to copy two sudirectories (although not the same two) from a dynamic directory to each slave. Seems like not that unusual a bit of functionality. Am I missing something???</p>