Exemple #1
0
    def generateCommands(props):
        name, archive, _ = namesFromProps(props)
        archive_full_command = archive_base_command + [archive, name+"/"]

        commands = []

        if disttarget:
            if isinstance(disttarget, str):
                disttarget_ = ["make", disttarget]
            else:
                disttarget_ = ["make"]
                disttarget_.extend(disttarget)

            commands.append(util.ShellArg(disttarget_,
                logname="make {0}".format(disttarget_[1]), haltOnFailure=True))

        commands.append(util.ShellArg(["mkdir", name],
            logname="archive", haltOnFailure=True))
        # Use a string for cp to allow shell globbing
        # WARNING: files aren't surrounded with quotes to let it happen
        commands.append(util.ShellArg('cp -r ' + ' '.join(files) + ' "{0}/"'.format(name),
            logname="archive", haltOnFailure=True))
        commands.append(util.ShellArg(archive_full_command,
            logname="archive", haltOnFailure=True))

        return commands
 def run(self):
     self.build.addStepsAfterCurrentStep([
         steps.ShellSequence(
             name='archive',
             haltOnFailure=True,
             logEnviron=False,
             commands=[
                 util.ShellArg(command=['tar', 'cf', 'state-dir.tar', '.flatpak-builder'], logfile='stdio'),
                 util.ShellArg(command=['tar', 'cf', 'repo.tar', 'repo'], logfile='stdio'),
             ],
         ),
         steps.FileUpload(
             name='upload state-dir.tar',
             haltOnFailure=True,
             workersrc='state-dir.tar',
             masterdest='flatpak/state-dir.tar',
         ),
         steps.FileUpload(
             name='upload repo.tar',
             haltOnFailure=True,
             workersrc='repo.tar',
             masterdest='flatpak/repo.tar',
         ),
         steps.MasterShellCommand(
             name='sync repo',
             haltOnFailure=True,
             logEnviron=False,
             command=['./scripts/flatpak-repo.sh'],
         ),
     ])
     return buildbot.process.results.SUCCESS
Exemple #3
0
def shellArg(command, logname, haltOnFailure=True, flunkOnFailure=True, warnOnFailure=True):
    return util.ShellArg(
        command=command,
        logname=logname,
        flunkOnFailure=flunkOnFailure,
        haltOnFailure=haltOnFailure,
        warnOnFailure=warnOnFailure)
Exemple #4
0
    def generateCleanup(props):
        name, _, _ = namesFromProps(props)

        commands = []
        commands.append(util.ShellArg(["rm", "-rf", name],
            logname="cleanup", haltOnFailure=True))
        return commands
Exemple #5
0
 def __init__(self, **kwargs):
     super(PrintConfiguration, self).__init__(timeout=60, **kwargs)
     self.commands = []
     # FIXME: Check platform before running platform specific commands.
     for command in self.command_list:
         self.commands.append(
             util.ShellArg(command=command, logfile=command[0]))
Exemple #6
0
 def __init__(self, **kwargs):
     super(PrintConfiguration, self).__init__(timeout=60, **kwargs)
     self.commands = []
     self.log_observer = logobserver.BufferLogObserver(wantStderr=True)
     self.addLogObserver('stdio', self.log_observer)
     # FIXME: Check platform before running platform specific commands.
     for command in self.command_list:
         self.commands.append(
             util.ShellArg(command=command, logfile='stdio'))
 def run(self):
     if self.worker.worker_system == "nt":
         sleep = "waitfor SomethingThatIsNeverHappening /t 100 >nul 2>&1"
     else:
         sleep = ["sleep", "100"]
     d = self.runShellSequence([util.ShellArg(sleep)])
     yield asyncSleep(1)
     self.interrupt("just testing")
     res = yield d
     return res
 def run(self):
     self.build.addStepsAfterCurrentStep([
         steps.FileDownload(
             name='download gpg archive',
             haltOnFailure=True,
             mastersrc='flatpak/flatpak-gpg.tar.gz',
             workerdest='flatpak-gpg.tar.gz',
         ),
         steps.ShellSequence(
             name='expand gpg archive',
             haltOnFailure=True,
             logEnviron=False,
             commands=[
                 util.ShellArg(command=['tar', 'xf', 'flatpak-gpg.tar.gz'], logfile='stdio'),
                 util.ShellArg(command=['rm', '-f', 'flatpak-gpg.tar.gz'], logfile='stdio'),
                 util.ShellArg(command=['gpg2', '--homedir', 'flatpak-gpg', '--list-keys'], logfile='stdio'),
             ],
         ),
     ])
     return buildbot.process.results.SUCCESS
Exemple #9
0
 def createRsyncSequence(self, hosts):
     """
     Creates a list of shell commands for synchronization of .config directory on each given host
     :param hosts: List of host addresses
     :return: List with rsync shell command for each host
     """
     return [
         util.ShellArg(
             command="rsync -r ~/.config/mdbci/repo.d/ -e "
             "'ssh -o UserKnownHostsFile=/dev/null StrictHostKeyChecking=no' "
             "vagrant@{}.mariadb.com:~/.config/mdbci/repo.d".format(host),
             logfile="rsync to {}.mariadb.com".format(host))
         for host in hosts
     ]
    def run(self):
        def does_state_tar_exist(step):
            return os.path.exists('flatpak/state-dir.tar')

        def does_repo_tar_exist(step):
            return os.path.exists('flatpak/repo.tar')

        def does_exist(step):
            return does_state_tar_exist(step) and does_repo_tar_exist(step)

        self.build.addStepsAfterCurrentStep([
            steps.FileDownload(
                name='download state-dir.tar',
                haltOnFailure=True,
                doStepIf=does_state_tar_exist,
                mastersrc='flatpak/state-dir.tar',
                workerdest='state-dir.tar',
            ),
            steps.FileDownload(
                name='download repo.tar',
                haltOnFailure=True,
                doStepIf=does_repo_tar_exist,
                mastersrc='flatpak/repo.tar',
                workerdest='repo.tar',
            ),
            steps.ShellSequence(
                name='unpack archives and clean up',
                haltOnFailure=True,
                doStepIf=does_exist,
                logEnviron=False,
                commands=[
                    util.ShellArg(command=['tar', 'xf', 'state-dir.tar', 'repo.tar'], logfile='stdio'),
                    util.ShellArg(command=['rm', '-f', 'state-dir.tar', 'repo.tar'], logfile='stdio'),
                ],
            ),
        ])
        return buildbot.process.results.SUCCESS