Next: , Previous: Running Commands on the Master, Up: Build Steps


4.11.9 Setting Properties

In Buildbot-0.8.3 and higher, slaves provide their environment variables to the master on connect. These can be copied into Buildbot properties with the SetPropertiesFromEnv step. Pass a variable or list of variables in the variables parameter, then simply use the values as properties in a later step.

     from buildbot.steps.slave import SetProperiesFromEnv
     from buildbot.steps.shell import Compile
     
     f.addStep(SetPropertiesFromEnv(variables=["SOME_JAVA_LIB_HOME", "JAVAC"]))
     f.addStep(Compile(commands=[WithProperties("%s","JAVAC"), "-cp", WithProperties("%s", "SOME_JAVA_LIB_HOME")))

Note that this step requires that the Buildslave be at least version 0.8.3. For previous versions, no environment variables are available (the slave environment will appear to be empty).

See also SetProperty, which runs a command on the slave and sets a property based on the result.