Beispiel #1
0
 def runCommand(self, cmd):
     cmd = RemoteShellCommand(workdir=".", command=cmd)
     cmd.buildslave = self
     cmd.logs["stdio"] = FakeLog()
     cmd._closeWhenFinished["stdio"] = False
     d = cmd.run(self, self.builder)
     return d
Beispiel #2
0
 def runCommand(self, cmd):
     cmd = RemoteShellCommand(workdir='.', command=cmd)
     cmd.worker = self
     cmd.logs['stdio'] = FakeLog()
     cmd._closeWhenFinished['stdio'] = False
     d = cmd.run(self, self.builder)
     return d
Beispiel #3
0
    def commandComplete(self, cmd):
        if not self._needToPullTestDotLog:
            return self._gotTestDotLog(cmd)

        # if the buildslave was too old, pull test.log now
        catcmd = ["cat", "_trial_temp/test.log"]
        c2 = RemoteShellCommand(command=catcmd, workdir=self.workdir)
        loog = self.addLog("test.log")
        c2.useLog(loog, True, logfileName="stdio")
        self.cmd = c2 # to allow interrupts
        d = c2.run(self, self.remote)
        d.addCallback(lambda res: self._gotTestDotLog(cmd))
        return d
Beispiel #4
0
    def commandComplete(self, cmd):
        if not self._needToPullTestDotLog:
            return self._gotTestDotLog(cmd)

        # if the buildslave was too old, pull test.log now
        catcmd = ["cat", "_trial_temp/test.log"]
        c2 = RemoteShellCommand(command=catcmd, workdir=self.workdir)
        loog = self.addLog("test.log")
        c2.useLog(loog, True, logfileName="stdio")
        self.cmd = c2  # to allow interrupts
        d = c2.run(self, self.remote)
        d.addCallback(lambda res: self._gotTestDotLog(cmd))
        return d
Beispiel #5
0
    def start(self):
        """
        Buildbot Calls Me when it's time to start
        """
        if self.autoRelease:
            relfile = '%s.release' % (
                self.os.path.basename(self.specfile).split('.')[0])
            try:
                rfile = open(relfile, 'r')
                rel = int(rfile.readline().strip())
                rfile.close()
            except:
                rel = 0
            self.rpmbuild = self.rpmbuild + ' --define "_release %s"' % rel
            rfile = open(relfile, 'w')
            rfile.write(str(rel+1))
            rfile.close()

        if self.vcsRevision:
            self.rpmbuild = self.rpmbuild + ' --define "_revision %s"' % \
                self.getProperty('got_revision')

        self.rpmbuild = self.rpmbuild + ' -ba %s' % self.specfile

        self.command = ['bash', '-c', self.rpmbuild]

        # create the actual RemoteShellCommand instance now
        kwargs = self.remote_kwargs
        kwargs['command'] = self.command
        cmd = RemoteShellCommand(**kwargs)
        self.setupEnvironment(cmd)
        self.checkForOldSlaveAndLogfiles()
        self.startCommand(cmd)
Beispiel #6
0
    def start(self):
        # this block is specific to ShellCommands. subclasses that don't need
        # to set up an argv array, an environment, or extra logfiles= (like
        # the Source subclasses) can just skip straight to startCommand()

        warnings = []

        # create the actual RemoteShellCommand instance now
        kwargs = self.remote_kwargs
        tmp = []
        if isinstance(self.command, list):
            self._flattenList(tmp, self.command)
        else:
            tmp = self.command

        kwargs['command'] = tmp
        kwargs['logfiles'] = self.logfiles

        # check for the usePTY flag
        if kwargs.has_key('usePTY') and kwargs['usePTY'] != 'slave-config':
            if self.slaveVersionIsOlderThan("svn", "2.7"):
                warnings.append(
                    "NOTE: slave does not allow master to override usePTY\n")

        cmd = RemoteShellCommand(**kwargs)
        self.setupEnvironment(cmd)
        self.checkForOldSlaveAndLogfiles()

        self.startCommand(cmd, warnings)
Beispiel #7
0
 def runCommand(self, cmd):
     cmd = RemoteShellCommand(workdir='.', command=cmd)
     cmd.buildslave = self
     cmd.logs['stdio'] = FakeLog()
     cmd._closeWhenFinished['stdio'] = False
     d = cmd.run(self, self.builder)
     return d
    def start(self):
        # this block is specific to ShellCommands. subclasses that don't need
        # to set up an argv array, an environment, or extra logfiles= (like
        # the Source subclasses) can just skip straight to startCommand()
        properties = self.build.getProperties()

        # create the actual RemoteShellCommand instance now
        kwargs = properties.render(self.remote_kwargs)
        kwargs['command'] = properties.render(self.command)
        kwargs['logfiles'] = self.logfiles
        cmd = RemoteShellCommand(**kwargs)
        self.setupEnvironment(cmd)
        self.checkForOldSlaveAndLogfiles()

        self.startCommand(cmd)
    def start(self):
        # this block is specific to ShellCommands. subclasses that don't need
        # to set up an argv array, an environment, or extra logfiles= (like
        # the Source subclasses) can just skip straight to startCommand()
        command = self._interpolateProperties(self.command)
        assert isinstance(command, (list, tuple, str))
        # create the actual RemoteShellCommand instance now
        kwargs = self._interpolateProperties(self.remote_kwargs)
        kwargs['workdir'] = self._interpolateWorkdir(kwargs['workdir'])
        kwargs['command'] = command
        kwargs['logfiles'] = self.logfiles
        cmd = RemoteShellCommand(**kwargs)
        self.setupEnvironment(cmd)
        self.checkForOldSlaveAndLogfiles()

        self.startCommand(cmd)
Beispiel #10
0
    def start(self):
        # Substitute build properties into command
        #command = self._interpolateProperties(self.command)
        command = self.command
        # fail assert if command is not of correct type
        assert isinstance(command, (list, tuple, str))

        # Get changed file list from the build which invoked this step
        files = self.build.allFiles()

        # Now we can do whatever we want with the list of changed files.
        # I will just append them to the end of the command.

        ## IGNORE THIS
        #log.msg("Build Files (STR): %s" % files)
        #files = " -t {quot}{files}{quot}".format(files=" ".join(files),quot='"')
        #command += files
        #log.msg("Build Files (TUPLE): %s" % files)
        #command += tuple(["-t", "{files}".format(files=" ".join(files))])
        #elif isinstance(command, list):
        #	log.msg("Build Files (LIST): %s" % files)
        #	command += ["-t", "{files}".format(files=" ".join(files))]

        # Convert file list so it can be appended to the command's type
        if isinstance(command, str):
            files = " ".join(files)
        elif isinstance(command, tuple):
            files = tuple(files)

        # .. and append files to end of command
        # (the type 'lists' is not handled above because it doesn't have to be)
        command += files

        # We have created the final command string
        # so we can fill out the arguments for a RemoteShellCommand
        # using our new command string
        kwargs = self.remote_kwargs
        kwargs['command'] = command
        kwargs['logfiles'] = self.logfiles
        kwargs['timeout'] = 3600

        # Create the RemoteShellCommand and start it
        cmd = RemoteShellCommand(**kwargs)
        self.setupEnvironment(cmd)
        #self.checkForOldSlaveAndLogfiles()
        self.startCommand(cmd)
Beispiel #11
0
    def doStartVC(self, html, branch, revision, path):
        info = parsehtml(html, self.archives)

        if info is None:
            # Got no consistent revision
            log.msg('Tar: got no consistent revision')
            self.failed('Couldn\'t get consistent revision')
            return
        (revision, links) = info

        cmdargs = ['curl', '-s']
        for link in links:
            cmdargs.append('-O')
            cmdargs.append(self.rooturl + link + '.tar.xz')

        cmd = RemoteShellCommand('build', command=(cmdargs))
        self.startCommand(cmd)