Ticket #100: builderWideEnvironnment.diff

File builderWideEnvironnment.diff, 1.5 KB (added by bhearsum, 13 years ago)

builder-wide environment

  • buildbot/process/base.py

    diff -rN -u old-upstream-buildbot-mirror/buildbot/process/base.py new-upstream-buildbot-mirror/buildbot/process/base.py
    old new  
    186186    def setLocks(self, locks):
    187187        self.locks = locks
    188188
     189    def setSlaveEnvironment(self, env):
     190        self.slaveEnvironment = env
     191
    189192    def getSourceStamp(self):
    190193        return self.source
    191194
  • buildbot/process/builder.py

    diff -rN -u old-upstream-buildbot-mirror/buildbot/process/builder.py new-upstream-buildbot-mirror/buildbot/process/builder.py
    old new  
    276276        self.builddir = setup['builddir']
    277277        self.buildFactory = setup['factory']
    278278        self.locks = setup.get("locks", [])
     279        self.env = setup.get(['env'], {})
     280        assert isinstance(self.env, dict)
    279281        if setup.has_key('periodicBuildTime'):
    280282            raise ValueError("periodicBuildTime can no longer be defined as"
    281283                             " part of the Builder: use scheduler.Periodic"
     
    585587        build = self.buildFactory.newBuild(requests)
    586588        build.setBuilder(self)
    587589        build.setLocks(self.locks)
     590        if len(self.env) > 0:
     591            build.setSlaveEnvironment(self.env)
    588592
    589593        # start it
    590594        self.startBuild(build, sb)