views:

312

answers:

3

First, the prior situation: We have this project with a one-click build script. It's cobbled together with TFS Deployer + PowerShell + VB Script. TFS Deployer sits on the production machine, copies the new website files into a brand new directory, and then calls a VB Script that changes the IIS website to the new directory.

Now, I'm moving the team away from the horror that is TFS/MSBuild. I have a TeamCity build agent on a dedicated build server. A simple NANT script deploys the build artifacts from the build server to the production server through a shared folder. Simple, quick, and effective.

However, I haven't found either a way a) to run the VB Script remotely b) update the IIS site remotely with a different mechanisms (programmatically within the 1-click build). Windows Server 2003/IIS6. Any ideas?

Update: I solved this by creating another vbs that remotely called the old vbs I had through WMI. Thanks everyone!

+1  A: 

Could you change the vbscript file into an ASP file in a different website on the same server? This would allow you to call it remotely.

Andrew Hare
+1  A: 

If I were to head in any direction, I would consider setting up a WMI script to do the work and then configuring it on the server in question. I would have to think about how to easily include this into your automated build. I personaally have not worked with TeamCity yet, although I have attended sessions on how it works.

WMI might be able to run the script, as well, and act as a sort of service front end, so you may be able to reuse what you have already spent effort on.

Gregory A Beamer
+1  A: 

We've used NAntContrib's mkiisdir task to create/modify a virtual directory on remote machines.

<mkiisdir iisserver="Staging" dirpath="c:\temp" vdirname="Temp" />

This should either create (if the vdir doesn't exist) or change the location (if the vdir already exists).

Generally, it seems the cleanest way to do this is to first delete the vdir with the deliisdir task, followed by a create.

<deliisdir vdirname="Temp" failonerror="false" />
<mkiisdir dirpath="c:\temp" vdirname="Temp" accessread="true" accesswrite="false" accessscript="true" enabledirbrowsing="false" authntlm="true" authbasic="false" authanonymous="false" appcreate="Pooled" />

Happy coding!

Scott Saad

related questions