Skip to content

Commit

Permalink
Add 'workdir' propetry containing path to base of slave builder.
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Prince <tom.prince@ualberta.net>
  • Loading branch information
tomprince committed Mar 26, 2011
1 parent c19d57d commit 23d9322
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions master/buildbot/buildslave.py
Expand Up @@ -22,6 +22,7 @@
from twisted.internet import defer, reactor
from twisted.application import service
from twisted.spread import pb
from twisted.python.reflect import namedModule

from buildbot.status.builder import SlaveStatus
from buildbot.status.mail import MailNotifier
Expand Down Expand Up @@ -335,6 +336,12 @@ def _accept_slave(res):
self.slave_basedir = state.get("slave_basedir")
self.slave_system = state.get("slave_system")
self.slave = bot
if self.slave_system == "win32":
self.path_module = namedModule("win32path")
else:
# most eveything accepts / as separator, so posix should be a
# reasonable fallback
self.path_module = namedModule("posixpath")
log.msg("bot attached")
self.messageReceivedFromSlave()
self.stopMissingTimer()
Expand Down
2 changes: 2 additions & 0 deletions master/buildbot/process/build.py
Expand Up @@ -183,6 +183,8 @@ def setupSlaveBuilder(self, slavebuilder):
# object that came from the config, and get its properties
buildslave_properties = slavebuilder.slave.properties
self.getProperties().updateFromProperties(buildslave_properties)
if slavebuilder.slave.slave_basedir:
self.setProperty("workdir", slavebuilder.slave.path_module.join(slavebuilder.slave.slave_basedir, self.builder.slavebuilddir), "slave")

self.slavename = slavebuilder.slave.slavename
self.build_status.setSlavename(self.slavename)
Expand Down
5 changes: 5 additions & 0 deletions master/docs/cfg-buildsteps.texinfo
Expand Up @@ -306,6 +306,11 @@ The repository of the sourcestamp for this build

The project of the sourcestamp for this build

@item workdir

The absolute path of the base working directory on the slave, of the current
builder.

@end table

@node Source Checkout
Expand Down

0 comments on commit 23d9322

Please sign in to comment.