[Buildbot-devel] CopyProperties for ShellCommand?
Mike Winter
miwinter at cisco.com
Thu Apr 12 23:07:26 UTC 2012
I need to pass a host of properties to a homespun Source kind of step to set the environment up.....and WithProperties is not quite right for I get a render exception, so I searched to
http://trac.buildbot.net/ticket/554 which is v close to solving something I need for a source and compile kind of build-step. I think of a solution like Source(cmd, env = CopyProperties('foo')). where foo: {'prop1': val1, 'prop2': val2}
You may ask why is the env-setting so large. I dont have an answer, but I know there are better ways.
The code might look like:
def glob2get_ace_env(rc, stdout, stderr):
lines = [l.strip() for l in stdout.split('\n') ]
filtered = '\n'.join(l for l in lines if l.find('=') != -1)
from configobj import ConfigObj
import StringIO
cfg = ConfigObj(StringIO.StringIO(filtered))
return {'ace_env': cfg.dict() }
def buildSteps(f, branch):
f.addStep(SetProperty(name='envfile',
command= ['/auto/itasca/tools/bin/aceInfo', '-b', branch, "envFile"],
property= "aceenvfile"))
f.addStep(SetProperty(name='envResult',
command=["bash", "-c", WithProperties("source %(aceenvfile)s; env")],
extract_fn=glob2get_ace_env))
step = ACME(name='acme',
mode='update'
environ = CopyProperties('ace_env'))
f.addStep(step)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20120412/8d99a67e/attachment.html>
More information about the devel
mailing list