Buildbot:如果文件不存在,如何跳过一个步骤?

标签 buildbot

在构建一些分支时,我需要跳过构建步骤。

更准确地说,我想执行一个 ShellCommand仅当要运行的脚本存在于源代码树中时才执行 step。

我试过:

ShellCommand(command=["myscript"],
             workdir="path/to",
             doStepIf=(lambda step: os.path.isfile("path/to/myscript")))

但该步骤永远不会执行。

最佳答案

def doesMyCriticalFileExist(step):
   if step.getProperty("myCriticalFileExists"):
      return True
   return False

<factory>.addStep(SetProperty(command='[ -f /path/to/myscript ] && ls -1 /path/to/myscript || exit 0', property='myCriticalFileExists')))
<factory>.addStep(ShellCommand(command=["myscript"], workdir="path/to", doStepIf=doesMyCriticalFileExist))

关于Buildbot:如果文件不存在,如何跳过一个步骤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28497714/

相关文章:

python - 对 buildbot 构建属性执行字符串转换?

python - 在其他客户端上的 buildbot 中执行构建步骤

git - 如何使用 buildbot 设置 git 提交后 Hook

html - 如何自定义 buildbot 网页

python - Buildbot 不以默认配​​置启动

buildbot - buildbot 工作线程关闭时的通知

docker - Docker内部的Docker中的卷?

python - "Pretty"Python 的持续集成

python - 如何附加到 BuildBot ShellCommand 的 PATH 环境变量

buildbot - 如何在公司中扩展 buildbot