[Buildbot-devel] work-dir with shell.WithProperties?

Axel Hecht l10n.moz at googlemail.com
Tue Jun 5 09:57:46 UTC 2007


You likely need both parts of my internal patch goodness. The first
actually ensures that you the working dir exists on your slave, the
second one adding support for WithProperties  to ShellCommand's
workdir.

I didn't test this outside of my own patches install, though.

Axel

Index: buildbot/slave/commands.py
--- buildbot/slave/commands.py
+++ buildbot/slave/commands.py
@@ -300,6 +300,9 @@
         return self.deferred

     def _startCommand(self):
+        # ensure workdir
+        if not os.path.isdir(self.workdir):
+            os.makedirs(self.workdir)
         log.msg("ShellCommand._startCommand")
         if self.notreally:
             self.sendStatus({'header': "command '%s' in dir %s" % \
Index: buildbot/steps/shell.py
--- buildbot/steps/shell.py
+++ buildbot/steps/shell.py
@@ -206,6 +206,8 @@
         assert isinstance(command, (list, tuple, str))
         # create the actual RemoteShellCommand instance now
         kwargs = self.remote_kwargs
+        if isinstance(kwargs['workdir'], WithProperties):
+            kwargs['workdir'] = kwargs['workdir'].render(self.build)
         kwargs['command'] = command
         kwargs['logfiles'] = self.logfiles
         cmd = RemoteShellCommand(**kwargs)




More information about the devel mailing list