简体   繁体   中英

How to take and assign value from force scheduler in buildbot

I need to take value (publish) from force scheduler (true/false), to be specified from checkbox and pass it to variable - to check if its true|false and the proceed proper step, then run build step.

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

So I tried to do it with Interpolate:

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

Gettings {'publish': False} - but only in steps - how can I pass it to variable?

I figured it out. I used doStepIf.. and step.getProperty..

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM