Steps to reproduce:
- Create a project with a space in the name, e.g. "Test project"
- Run the following shell command on build: /usr/local/bin/python $WORKSPACE/build.py
- Run the build
- Receive following output as console output:
Started by timer Building in workspace /Users/Shared/Jenkins/Home/jobs/Test project/workspace [workspace] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson8678281940954009674.sh + /usr/local/bin/python /Users/Shared/Jenkins/Home/jobs/Test project/workspace/build.py /usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/Shared/Jenkins/Home/jobs/Test': [Errno 2] No such file or directory Build step 'Execute shell' marked build as failure Finished: FAILURE
The space in "Test project" is not escaped and causes a failure.
Workaround is to rename the project to not contain spaces.
https://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html#Word-Splitting