Skip to content

Teamcity & NAnt – How to copy files to another server.

by dotnetdave on April 20th, 2010

So you have done your continuous integration, all the tests pass and the metrics all pass. So the next task is to get your code onto a test server for the test team to examine with there fine toothed comb. Getting the code from one server to another can be tricky. So here is the solution that I found.





		

		
			
				
				
			
		

		

		

	
			
				
			
		

		

This uses the net use command line to create a shared directory and pipe the response to a temporary file. With some regular expression magic to extract the drive letter from the response into a property. Then copy the code from the server using the NAnt copy task with the new mapped drive. Finally user the net use command to remove the mapped drive. Once and permissions issues are resolved then this works like a dream.

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS