[Buildbot-devel] setting environment variables in build steps

Brian Warner warner-buildbot at lothar.com
Sat Dec 8 21:08:06 UTC 2007


On Fri, 23 Nov 2007 07:43:49 -0500
Stefan Seefeld <seefeld at sympatico.ca> wrote:

> Axel Hecht wrote:
> 
> > So, by default, buildername, buildnumber, branch, revision,  and
> > slavename are set properties, see
> > http://buildbot.net/trac/browser/buildbot/process/base.py#L258.
> 
> Yes, I have seen that list. (I'm a bit surprised to find such rather
> domain-specific variables available in general. Not all builds rely on
> revision control. Or may be they do...)
> 
> I was actually thinking that a set of variables including workdir are
> common enough to be useful to expose, too.

Yeah, I think having workdir in the per-BuildStep property list could be
pretty useful. It's worthwhile to remember, however, that the master's
concept of "workdir" is only relative: it does not know what directory the
buildslave is running in, so it couldn't create an absolute pathname for the
workdir, which is (I think) what you'd probably want. A relative pathname for
the workdir doesn't sound too useful to me.

The full derivation is:

 buildslave's base directory (specified when the buildslave is created)
 + builder directory (specified in master.cfg)
 + workdir (specified by the BuildStep arguments)

and the buildmaster never learns of the buildslave's basedir.


Remember, the workdir stuff is mostly there to be overridden in source
checkout steps, to allow CVS to run from "." (and create or populate
"build/") and then have all other steps run inside "build/". The supporting
code is still in the "one project at a time" mindset, so having different
steps running in different workdirs is probably not going to be as easy as
you'd like.

cheers,
 -Brian




More information about the devel mailing list