Ticket #43: workdir.patch

File workdir.patch, 0.9 kB (added by Pike, 2 years ago)

support WithProperties? for workdir, and ensure that dir, too.

  • buildbot/slave/commands.py

    old new  
    300300        return self.deferred 
    301301 
    302302    def _startCommand(self): 
     303        # ensure workdir 
     304        if not os.path.isdir(self.workdir): 
     305            os.makedirs(self.workdir) 
    303306        log.msg("ShellCommand._startCommand") 
    304307        if self.notreally: 
    305308            self.sendStatus({'header': "command '%s' in dir %s" % \ 
  • buildbot/steps/shell.py

    old new  
    206206        assert isinstance(command, (list, tuple, str)) 
    207207        # create the actual RemoteShellCommand instance now 
    208208        kwargs = self.remote_kwargs 
     209        if isinstance(kwargs['workdir'], WithProperties): 
     210            kwargs['workdir'] = kwargs['workdir'].render(self.build) 
    209211        kwargs['command'] = command 
    210212        kwargs['logfiles'] = self.logfiles 
    211213        cmd = RemoteShellCommand(**kwargs)