如何从buildbot中的强制调度器获取和分配值

2024-10-01 00:23:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要从force scheduler(true/false)中获取值(publish),从复选框中指定,并将其传递给变量-检查其值是否为true | false,并继续执行正确的步骤,然后运行构建步骤

properties=[
        util.NestedParameter(name="options", label="Build Options", layout="vertical", fields=[
            util.BooleanParameter(name="publish",
                                  label="Publish",
                                  default=False)
        ])

所以我试着用插值法:

util.Interpolate('%(prop:options)s')

Gettings{'publish':False}——但只能分步骤进行——如何将其传递给变量


Tags: namefalsetrueutil步骤propertiespublishlabel
1条回答
网友
1楼 · 发布于 2024-10-01 00:23:08

我想出来了。我用了多斯泰普夫。。和步骤。getProperty

steps.ShellCommand(
    name='Change to TRUE publish',
    doStepIf=lambda step: step.getProperty('options') == {'publish': True},

相关问题 更多 >