views:

43

answers:

2

How can I remotely execute a commands on a Windows box as part of a build process?

If it matters, I want to initiate the commands from a linux machine which is performing the actual build.

To give some background...

A web application I am currently working on has, as part of the build process, a system for automatically reverting a linux VM, ssh-ing into it, installing the software, and then running a set of tests over the web interface. I'd like to do the same thing for Windows, but I'm not sure what the equivalent of ssh-ing in would be on a Windows machine.

Installing Cygwin to get sshd isn't an option (risks the system picking up some sort of cygwin dependency which this process is intended to prevent) and obviously something like remote desktop is fine for interactive use, but would not help me script the process (as far as I know).

+1  A: 

I will mention it anyways (even though you said cygwin was out) one thing you could use is Fresshd. Its lightweight and works very well from what I can tell. Beyond needing to be installed so it can run as a service it appears to have no other dependencies.

Another option is Powershell and WinRM which allows you to use native .NET for doing windows management. Unfortunately I have no idea how you would actually get it to work from linux without using a VM environment to kick it off. Neverless it allows you to script processes and push those processes to the remote machines to be executed.

The last two options, which I have seen used in different shops, is to A) push a install script to the remote machine, then interactively log in and initiate it or B) push the install script but ensure that the machine on boot up (or first log in) will always run "setup.bat" which checks for a new version of the app and installs it. Both have their downsides of course.

Their are a few other ways, but I am not sure how you could get them to work for you. Unattended MSI installs (or silent installs) but I do not have any experience with such. The first couple google hits appear to be products which build MSI files for you.

Hope that helps.

GrayWizardx
freesshd looks interesting - Is it actually pulling across a bunch of cygwin stuff under the hood?A quick look seemed to indicate it was just an ssh daemon which would execute cmd.exe which may well be perfect.
Matt Sheppard
Im actually not sure what it is doing. I think I read somewhere it was built from the ground up, but that could be confusing something else. I had some users that needed to transfer data between linux and windows and that worked fine for SFTP, I have not tried the SSH part, but heard good things.
GrayWizardx
A: 

You can take a look at the windows secure file transfer tools if ssh-ing is not the only option. Things like winscp may work.

Rajasankar
I'm not sure how I would use file transfer to execute commands though - I guess I could have something poll a directory and execute added files or something, but that's a lot of moving parts...
Matt Sheppard