[Buildbot-devel] Setup of client's environment from client

Trask trask at techsoft3d.com
Thu May 19 19:14:34 UTC 2011


     * Buildbot: 0.8.3p1
     * Twisted: 10.1.0
     * Jinja: 2.5.2
     * Python: 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC 4.4.5]
     * Buildmaster platform: linux2

In order to follow best practices I am working to capture all 
configuration information within the source itself so that it is 
versioned, tagged, etc right along with everything else.

One particular part has been giving me problems: how to set up the slave 
environment based upon code it has checked out in a buildstep.  If I set 
everything in master.cfg on the buildmaster, everything works fine, 
however that does not capture the configuration data within the 
ever-changing source.

My original idea was to run a "setup-environment.py" script which would 
always be run prior to the other build steps.  This doesn't work because 
it is only modifying the environment for it's own process.  Even if it 
did modify the global environment that is not ideal due to likely 
collisions with simultaneous usage of the machine.

My next attempt was to encapsulate every command within a "setup-env" 
script.  You pass the command to run to the script as an argument and 
then it sets up the environment and then runs the command.  I've gotten 
this to work to a degree but is clearly not the proper way to accomplish 
what I am trying to do.

BuildProperties seems promising but I haven't thought of a clean way to 
use them.  I could imagine running the "setup-env" script, having it 
spit out the proper environment settings to use and then using 
"SetProperty" with a custom function to set Properties which THEN get 
translated into environment settings on the client.  Hmmph.

This seems like an issue that would crop up for a lot of people so I am 
interested in hearing how other people have solved this.

Thanks for any help!

~Trask





More information about the devel mailing list