Exemplo n.º 1
0
    def _job_30_run(self, build, lock_path, log_path):
        if not build.branch_id.repo_id.is_travis2docker_build:
            return super(RunbotBuild,
                         self)._job_30_run(build, lock_path, log_path)
        if (not build.docker_image or not build.dockerfile_path
                or build.result == 'skipped'):
            _logger.info('docker build skipping job_30_run')
            return MAGIC_PID_RUN_NEXT_JOB

        # Start copy and paste from original method (fix flake8)
        build._log('run', 'Start running build %s' % build.dest)
        log_all = build._path('logs', 'job_20_test_all.txt')
        log_time = time.localtime(os.path.getmtime(log_all))
        v = {
            'job_end': time2str(log_time),
        }
        if grep(log_all, ".modules.loading: Modules loaded."):
            if rfind(log_all, _re_error):
                v['result'] = "ko"
            elif rfind(log_all, _re_warning):
                v['result'] = "warn"
            elif not grep(build._server("test/common.py"), "post_install") or \
                    grep(log_all, "Initiating shutdown."):
                v['result'] = "ok"
        else:
            v['result'] = "ko"
        build.write(v)
        build._github_status()
        # end copy and paste from original method

        cmd = ['docker', 'start', '-i', build.docker_container]
        return self._spawn(cmd, lock_path, log_path, cpu_limit=None)
Exemplo n.º 2
0
 def _cmd(self):
     self.ensure_one()
     if self.repo_id.uses_buildout:
         if not os.path.exists(self._path('datadir')):
             os.mkdir(self._path('datadir'))
         cmd = [
             self._path('bin/start_%s') % self.buildout_section,
             '--xmlrpc-port=%d' % self.port,
             '--data-dir', self._path('datadir'),
             '--addons-path', self._server('addons'),
         ]
         if grep(self._server('tools/config.py'), 'no-xmlrpcs'):
             cmd.append('--no-xmlrpcs')
         if grep(self._server('tools/config.py'), 'no-netrpc'):
             cmd.append('--no-netrpc')
         if grep(self._server('tools/config.py'), 'log-db'):
             cmd.append('--log-db=%s' % self.env.cr.dbname)
         return cmd, self.modules
     else:
         return super(RunbotBuild, self)._cmd()