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])
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")
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")
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)
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)
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)
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'))
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)
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)