I've tried executing the following:
#!C:\cygwin\bin\bash.exe
ls ${WORKSPACE}
But that doesn't find ls (even if it's on the windows path). Is there any way to set this up?
UPDATE: In other words, I want to be able to set up a build step that uses cygwin bash instead of windows cmd like this page shows you how to do with Python.
-
That shell-script has two errors: the hash-bang line should be "#!/bin/bash", and ${WORKSPACE} is not a shell-variable. Hudson has a bunch of variables of its own which are expanded in the commands you specify to be run (i.e. when you add commands in the web gui).
If you want to run Hudson build step on the Cygwin command line, you need to figure out what command Hudson runs and in which directory.
To give a more specific answer, you need to show us how your project is configured and what steps you want to run separately.
Jason Baker : I think I might have worded myself poorly. I'm wanting to run a command from cygwin in hudson (like this page shows you how to use python: http://wiki.hudson-ci.org/display/HUDSON/Shells) -
you might want to try to give a full path to ls
/cygdrive/c/cygwin/bin/ls
Jason Baker : I can do that, but it would be kind of a PITA. :-) -
One other thing that seems to work is to use this:
#!C:\cygwin\bin\bash.exe export PATH=$PATH:/usr/bin ls
But it would be nice not to have to modify the path for every script.
-
So put your
cygwin
'sbin
directory in yourPATH
.In case you don't know how to do it (
Control Panel
->System
->Advanced
->Environment Variables
), see: http://support.microsoft.com/kb/310519 -
Provided cygwin's bin folder is in your path, the following works for me:
#!/bin/sh ls ${WORKSPACE}
I find Hudson does not pick up environment variable changes unless you restart the server.
-
Have you thought about power shell? as much as I like cygwin, it's always been a little flaky, powershell is a solid fully functional shell on windows, another option is Windows Services for UNIX it gives you korn shell or c shell not quite as nice as bash but it gets the job done
0 comments:
Post a Comment