[Buildbot-devel] dynamically finding the workdir for some build step

Matthew Morse matt at apple.com
Sat Apr 30 02:08:14 UTC 2011


Hi,

I haven't been having luck figuring this out, and it seems like it should be easy (so I'm frustrated ;-).

The problem is that I don't know the workdir for some step until runtime (the folder name has a git hash in it that changes).

But, I have a command that will find the proper path for me. So, I want to run that command, get the path, and use it for the next build step. It looks like a SetProperty step is what I want, but how do I pass the property between buildsteps?


Here's the situation in code:

--------------------------------------------------------------------------------
def new_working_dir_path(rc, stdout, stderr):
        desired_path = stdout.strip()
        return { "desired_path" : desired_path }


# Get path for following step
builder.addStep(
        shell.SetProperty,
        command=some_command_that_prints_desired_path_to_stdout,
        extract_fn=new_working_dir_path,
   )


builder.addStep(
        shell.ShellCommand,
        command=some_command_that_needs_to_execute_at_the_desired_path,
        workdir=<how do I get to the desired_path property?>,
   )
--------------------------------------------------------------------------------


Thanks,
- Matt





More information about the devel mailing list