尝试在我的 Jenkins 服务器上运行构建时出现错误。以下是输出显示的内容。这是在我更新到最新版本的 Jenkins 之后发生的。我还验证了所有插件都是最新的。
[EnvInject] - Loading node environment variables. [workspace] $ /bin/sh -xe /tmp/hudson229576663898687231.sh /tmp/hudson229576663898687231.sh: 1: /tmp/hudson229576663898687231.sh: Syntax error: end of file unexpected (expecting ")") Build step 'Execute shell' marked build as failure Finished: FAILURE
进一步调试似乎每当我添加一个执行 shell 构建选项时都会抛出错误。例如在执行 shell block 中。
ls -al;
此外,Jenkins 安装在 Ubuntu 12.10 机器上。
最佳答案
经过进一步调试,我弄清楚了发生了什么。 Jenkins 使用默认为
#!/bin/sh
但似乎不是默认的。我在我的命令脚本之上添加了它,现在它工作得很好。
关于bash - Jenkins 更新语法错误 : end of file unexpected (expecting ")") Execute Shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22204732/