Good tools and scripts can handle spaces and other weirdness in file/folder names. This is not a Jenkins issue (unless it happened in a Jenkins component -- but it doesn't look like it!).
If you write your own shell scripts, remember to double-quote variable references. For example, `some_command "$FOO"` is often better than `some_command $FOO` (except when it's not :-) ). On 03.12.2013, at 22:55, andrea crotti <[email protected]> wrote: > Argh true I missed that, I expected that jenkins would have quoted the spaces > since it lets me enter them, is that a known issue than? > I'll try without tomorrow, thanks > > On 3 Dec 2013 20:48, "Geoff Cummings" <[email protected]> wrote: > > Not sure what that script is doing, but make sure to consider spaces in the > jenkins job name. > >> /var/lib/jenkins/jobs/spotlight integration and selenium/workspace > > Personally I don't allow spaces in job names.. > > > On 3 Dec 2013, at 18:14, Jonathan Rogers <[email protected]> wrote: > > andrea crotti wrote: >> So I was trying to do something like this, and I created this bash >> script which locally works perfectly fine. >> >> However it doesn't seem to work at all with the error pasted below. >> Is Jenkins able to run any bash script? >> It seems like it should be I'm not sure why it gives this error though.. > > In "Execute shell" blocks, Jenkins just tries to use the system shell by > default AFAIK. On Unix-like systems, that should be /bin/sh, which could > be Bash or something else, depending on the system. You should try to > make the scripts you put in "Execute shell" blocks standard Bourne shell > and/or test them with /bin/sh. Alternatively, you can set a specific > shell executable in the global Jenkins config. > >> >> #!/bin/bash >> SPOTLIGHT_PID="not" >> API_PID="not" >> >> function create_ve { >> if [ ! -d ve ] >> then virtualenv ve >> fi >> } >> >> function start_spotlight { >> cd wazoku-spotlight/spotlight >> create_ve >> ve/bin/pip install -r test-requirements.txt >> ve/bin/python manage.py runserver & >> SPOTLIGHT_PID=$! >> cd - >> } >> >> start_spotlight >> >> cd wazoku-spotlight/spotlight >> ve/bin/python manage.py test tests/integration --with-xunit >> >> kill $SPOTLIGHT_PID > > Is the above script what you put in an "Execute shell" block? Don't put > a shebang in those, though it shouldn't matter much. > >> >> ERROR: >> >> Pip.....................................................................................................................................................................................................................................................................................................................................done. >> ./run-tests-jenkins.sh: ve/bin/pip: "/var/lib/jenkins/jobs/spotlight: >> bad interpreter: No such file or directory >> /var/lib/jenkins/jobs/spotlight integration and selenium/workspace >> Traceback (most recent call last): >> File "run.py", line 1, in <module> >> from bottle import run >> ImportError: No module named bottle >> New python executable in ve/bin/python >> Installing >> Setuptools..............................................................................................................................................................................................................................done. >> Installing > > It's pretty clear that something couldn't find > "/var/lib/jenkins/jobs/spotlight". Figure out what was looking for that > file and why it couldn't find it. > > -- > Jonathan Rogers > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- > You received this message because you are subscribed to a topic in the Google > Groups "Jenkins Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/jenkinsci-users/zheMR_OVYI8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
