views:

542

answers:

1

I'm having what I hope to be a simple problem. However, it's had me stumped all day.

I'm working with cruisecontrol in windows, being set up through Cygwin. I have some CC experience in the linux platform and much of what I'm doing is very similar. However, most any command I try to execute in the config.xml file's Schedule section is giving an error.

Here's the exception:

ExecBuilder - Could not execute command: /cygdrive/d/Program\ Files/Subversion/bin/svn
net.sourceforge.cruisecontrol.CruiseControlException: Encountered an IO exception while attempting to execute 'net.sourceforge.cruisecontrol.builders.ExecScript@b80f1c'. CruiseControl cannot continue.
at net.sourceforge.cruisecontrol.builders.ScriptRunner.runScript(ScriptRunner.java:133)

Here are some examples of commands I've tried to run which give this type of error.

<exec command="${CCLoc}/projects/${project.name}/IOSdllScript"/>

-Runs a script that I tested outside of the cruisecontrol.bat and it runs. Includes #!/bin/sh as the first line

<exec command="${CCLoc}/projects/${project.name}/EmptyFile"/>

-Essentially an empty text file, proving that the problem had nothing to do with my script.

<exec command="/cygdrive/d/Program\ Files/Subversion/bin/svn" args="cleanup" workingdir="${svndir}"/>

-Trys svn cleanup on a directory. I double checked the pathing and spelling.

One command that I tested worked and didn't give this error. That command was touch.

<exec command="touch" args="ABC.txt"/>

I'm not sure why only touch seems to work and nothing else does.

Thank you for your help.

A: 

Re: GrzegorzOledzki's comment:

Correct, but you gave me an idea which ended up helping this, though its far from the ideal solution.

I noticed that all of the commands that fail use paths and the command that works didn't. I tried a few more things with this in mind.

Things that work:

<exec command="touch" workingdir="projects" args="ABC.txt"/>
<exec command="svn" args="cleanup" workingdir="${svndir}/Iosdll"/>

These paths have to be relative not absolute fyi :(

Things that still didn't work:

Trying to run my script using this format (Same error)

Trying to run a script that doesn't exist (Same error!!!)

Executing multiple exec command... like a top down program (only runs first)

Apparently, this ExecScript IO exception is some kind of generic cannot run the command error. Messing around with command="path/script" or command="script" workingdir="path" yielded no results. So I just went into /etc/profile (cygwin's bash_profile equivalent) and added the path to my script to PATH. Now this sort of works.

<exec command="IOSdllScript.bat"/>

Edit: Seems to work better as a batch file than a script when going through Cygwin.

I still would like to know how to do this the "right" way, IE without having to change cygwin's PATH variable.