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

标签 python environment-variables buildbot

我需要更改构建步骤的构建环境变量。但当前环境参数仅替换现有环境变量。

有谁知道如何让 buildbot 附加到 PATH 环境变量而不是替换:

my_return.addStep(ShellCommand(command=["qmake", "{0}.pro".format(pro_name)],
                               env={'PATH': qt_path}))

最佳答案

您可以通过将 $PATH 放在现有值的末尾来扩展/附加到 PATH 环境变量。像这样的东西:

my_return.addStep(ShellCommand(command=["qmake", "{0}.pro".format(pro_name)],
                               env={'PATH': [qt_path, "${PATH}"]}))

更多详细信息请参见 buildbot documentation .

关于python - 如何附加到 BuildBot ShellCommand 的 PATH 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32185753/

相关文章:

python - 在 Python 中将列表的名称作为字符串获取

c# - 无法在 asp.net core web API 6.0 中获取环境变量

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

linux - buildbot 安装 : git poll failed

python - 使用 Python 在数据库中使用 Like 语句

python - 在 Tensorflow Object Detection API 中打印类名和分数

python - 用于连续输入和连续输出的 Keras LSTM

windows-7 - setx 命令在 Windows 7 中的位置是什么?

c++ - 具有独立主机环境的线程 (c++)