Exemplo n.º 1
0
 def _clone(self, source, target, rm=False):
     log.info("Cloning %s over to %s" % (source, target))
     if os.path.exists(target):
         if rm:
             log.info('Deleting %s first' % target)
             # response = raw_input('%s exists, delete? y/n' % self.target_dir)
             # if response == 'n':
             #     raise Exception('foo')
             # yoh: no need to divert from Python
             #run_cmd('rm -rf %s' % self.target_dir)
             shutil.rmtree(target)
         else:
             raise RuntimeError("Target directory %s already exists. "
                                "Can't clone into it" % target)
     run_cmd(['git', 'clone', source, target])
Exemplo n.º 2
0
 def _clone(self, source, target, rm=False):
     log.info("Cloning %s over to %s" % (source, target))
     if os.path.exists(target):
         if rm:
             log.info('Deleting %s first' % target)
             # response = raw_input('%s exists, delete? y/n' % self.target_dir)
             # if response == 'n':
             #     raise Exception('foo')
             # yoh: no need to divert from Python
             #run_cmd('rm -rf %s' % self.target_dir)
             shutil.rmtree(target)
         else:
             raise RuntimeError("Target directory %s already exists. "
                                "Can't clone into it" % target)
     run_cmd(['git', 'clone', source, target])
Exemplo n.º 3
0
 def _build(self):
     cmd = ';'.join(
         [x for x in self.build_cmds.split('\n') if len(x.strip()) > 0])
     proc = run_cmd(cmd, shell=True, cwd=self.target_dir)
     if proc.returncode:
         raise FailedToBuildError(
             "Failed to build. See stderr in the log for details")
Exemplo n.º 4
0
 def _build(self):
     cmd = ';'.join([x for x in self.build_cmds.split('\n')
                     if len(x.strip()) > 0])
     proc = run_cmd(cmd, shell=True, cwd=self.target_dir)
     if proc.returncode:
         raise FailedToBuildError(
             "Failed to build. See stderr in the log for details")
Exemplo n.º 5
0
    def _copy_benchmark_scripts_and_deps(self):
        pth, _ = os.path.split(os.path.abspath(__file__))
        deps = [os.path.join(pth, 'scripts/vb_run_benchmarks.py')]
        if self.dependencies is not None:
            deps.extend(self.dependencies)

        for dep in deps:
            proc = run_cmd('cp %s %s' % (dep, self.target_dir), shell=True)
Exemplo n.º 6
0
    def _copy_benchmark_scripts_and_deps(self):
        pth, _ = os.path.split(os.path.abspath(__file__))
        deps = [os.path.join(pth, 'scripts/vb_run_benchmarks.py')]
        if self.dependencies is not None:
            deps.extend(self.dependencies)

        for dep in deps:
            proc = run_cmd('cp %s %s' % (dep, self.target_dir), shell=True)
Exemplo n.º 7
0
 def _clean(self):
     if not self.clean_cmd:
         return
     cmd = ';'.join(
         [x for x in self.clean_cmd.split('\n') if len(x.strip()) > 0])
     proc = run_cmd(cmd, shell=True, cwd=self.target_dir)
Exemplo n.º 8
0
 def _prep(self):
     cmd = ';'.join(
         [x for x in self.prep_cmd.split('\n') if len(x.strip()) > 0])
     proc = run_cmd(cmd, shell=True, cwd=self.target_dir)
Exemplo n.º 9
0
 def _checkout(self, rev):
     git = _git_command(self.target_dir)
     rest = 'checkout -f %s' % rev
     args = git.split() + rest.split()
     # checkout of a detached commit would always produce stderr
     proc = run_cmd(args, stderr_levels=('debug', 'error'))
Exemplo n.º 10
0
 def _clean(self):
     if not self.clean_cmd:
         return
     cmd = ';'.join([x for x in self.clean_cmd.split('\n')
                     if len(x.strip()) > 0])
     proc = run_cmd(cmd, shell=True, cwd=self.target_dir)
Exemplo n.º 11
0
 def _prep(self):
     cmd = ';'.join([x for x in self.prep_cmd.split('\n')
                     if len(x.strip()) > 0])
     proc = run_cmd(cmd, shell=True, cwd=self.target_dir)
Exemplo n.º 12
0
 def _checkout(self, rev):
     git = _git_command(self.target_dir)
     rest = 'checkout -f %s' % rev
     args = git.split() + rest.split()
     # checkout of a detached commit would always produce stderr
     proc = run_cmd(args, stderr_levels=('debug', 'error'))