【发布时间】:2019-08-01 02:17:26
【问题描述】:
我在 Bitbucket Repo 中有一个简单的 hello world python 脚本。我已将我的 Bamboo 和 Bitbucket 与具有两个任务的 Default job 相关联:
- 源代码签出
- 脚本
当我使用Inline 的脚本运行计划并输入python hello_world.py 时,它工作正常并在logs 中打印出“hello world”。
但是当我使用脚本作为file 运行计划并将文件名指定为“hello_world.py”时。构建失败并在日志中显示以下内容:
Failing task since return code of [/var/lib/ci/xml-data/build-dir/ABCD-BAM-JOB1/hello_world.py] was -1 while expected 0
在 GNU linux 中运行的竹子。
我的脚本
#! /usr/bin python
print('Hello World')
编辑 1
解释器有三个选项
- 壳牌
- windows powershell
- /bin/sh 或 cmd.exe
【问题讨论】:
-
在脚本配置窗格中,“解释器”还有哪些其他选项?
-
嗨@brentertainer。我已经在问题中进行了编辑。
-
我很困惑。壳牌似乎是正确的方法。我注意到的另一件事是,在您的帖子中,
#!和/usr/bin/python之间还有一个空格。也许确保当您从我的回答中尝试时,您不包括该空间。如果不是这样,我就无所适从了。 -
@brentertainer 是的,我也删除了空间。好的谢谢你的帮助。我会看看我能做什么。