4

I am working on a distributed solution (written in .NET) that includes WCF services, Windows managed services and has dependencies to other native and managed solutions. The primary goal of the project is to perform various testing of another distributed system.

The build is deployed with one click in TeamCity. The binaries of test harness and the tested distributed system go to the shared folder. To deploy it all I have a few .bat and powershell scripts which also live in the shared folder. I constantly work on the scripts and they get updated, so I want to keep them in the source control.

What are the possible locations to store deployment scripts?

Right now I have a dedicated folder in the solution, but I am not too sure this is a good approach. I haven't figured out the way to deploy scripts to the shared folder on each TeamCity build.

/solution
   /app [test harness code]
   /test [unit, functional, integration, capacity tests]
   /deployment 
      /scripts [.bat and .ps1 scripts only]
         /TeamCity [copy binaries to share folder on TeamCity]
         /VM [scripts for installation of test harness and unit under test]

UPDATE
Deployment scripts I am talking about should be stored in a shared folder on the Team City machine. In the testing scenarios several VMs copy these scripts to the local folders and then execute them. Depending on the script and VM assignment, different binaries are copied to the VM and different installations performed. Scripts are usually < 100 lines but are quite different from component to component and are constantly updated.

I store scripts in a Visual Studio solution folder without the .csproj file, and thus they are not copied when Team City checks out the code from repository, and thus I cannot copy them to the shared folder.

oleksii
  • 35,458
  • 16
  • 93
  • 163

1 Answers1

1

Looks fine to me. I usually do something similar if I will be performing continuous integration.

Edit: I just noted the part about deploying scripts to the shared folder. What do you mean exactly? Are your scripts also under source control?

Joshua Dale
  • 1,773
  • 3
  • 17
  • 25
  • Thanks for the answer. Yeah, I need those scripts to be in the source control, as they are complex. I also need them overriden in the shared folder on a TeamCity build. – oleksii Jul 12 '11 at 21:27
  • Sorry, I just noticed you mentioned that already. What about including them as build artifacts as part of your your build process? Like using the copy task in msbuild? Assuming that is what you are using. – Joshua Dale Jul 12 '11 at 21:42
  • Build artifacts are stored in a separate location that change with everybuild and I can't point it to the share folder. From the other hand I cannot make those files Copy-IfNewer in the properties as they are not under the .csproj project and this option is not available. – oleksii Jul 12 '11 at 21:53
  • I assumed the shared folder was the build artifact folder. Do you have a seperate build script you run or are you just using msbuild on the csproj files directly? If you have an external build script it shouldn't be any problem to copy over the deployment scripts even if they are on a remote share. You could hand modify the csproj file to include the deployment scripts, but I wouldn't. – Joshua Dale Jul 12 '11 at 22:25
  • I am using Visual Studio .sln runner to build the project, but yeah I was thinking to create a .csproj file and copy the files there, but it seems like a dirty hack. – oleksii Jul 13 '11 at 10:07
  • Creating another msbuild file that triggers a build on your sln file is pretty standard for CI, but your right. Managing individual files with it can get messy. I use the msbuild file for moving sandcastle generated documentation to a webserver. – Joshua Dale Jul 13 '11 at 13:31
  • FYI with your update. As long as your files are somewhere relative to your projects they can be manipulated. Since they are in the same source control as the project, the build process has access to them and can manipulate them in any way. Your best bet is creating another msbuild file and using that for your build on TeamCity. – Joshua Dale Jul 13 '11 at 13:35