コード例 #1
0
 def build_has_any_failed_tasks(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.any_task_failed()
コード例 #2
0
 def wait_for_build_to_finish(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.wait_for_finish()
コード例 #3
0
 def build_was_cancelled(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.was_cancelled()
コード例 #4
0
 def build_not_finished(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.has_not_finished()
コード例 #5
0
 def build_has_succeeded(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.has_succeeded()
コード例 #6
0
 def get_build_reason(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.status_reason
コード例 #7
0
 def get_build(self, build_name):
     pipeline_run = PipelineRun(self.os, build_name)
     return pipeline_run.get_info()
コード例 #8
0
    def create_binary_container_pipeline_run(
            self,
            git_uri=_REQUIRED_PARAM,
            git_ref=_REQUIRED_PARAM,
            git_branch=_REQUIRED_PARAM,
            component=None,
            flatpak=None,
            git_commit_depth=None,
            isolated=None,
            koji_task_id=None,
            target=None,
            operator_csv_modifications_url=None,
            **kwargs):

        required_params = {
            "git_uri": git_uri,
            "git_ref": git_ref,
            "git_branch": git_branch
        }
        missing_params = []
        for param_name, param_arg in required_params.items():
            if param_arg is _REQUIRED_PARAM or not param_arg:
                missing_params.append(param_name)
        if missing_params:
            raise OsbsException('required parameter {} missing'.format(
                ", ".join(missing_params)))

        if operator_csv_modifications_url and not isolated:
            raise OsbsException(
                'Only isolated build can update operator CSV metadata')

        repo_info = utils.get_repo_info(git_uri,
                                        git_ref,
                                        git_branch=git_branch,
                                        depth=git_commit_depth)

        self._checks_for_flatpak(flatpak, repo_info)

        req_labels = self._check_labels(repo_info)

        user_params = self.get_user_params(
            base_image=repo_info.base_image,
            component=component,
            flatpak=flatpak,
            isolated=isolated,
            koji_target=target,
            koji_task_id=koji_task_id,
            req_labels=req_labels,
            repo_info=repo_info,
            operator_csv_modifications_url=operator_csv_modifications_url,
            **kwargs)

        self._checks_for_isolated(user_params)

        pipeline_run_name = self._get_binary_container_pipeline_name(
            user_params)
        pipeline_run_data = self._get_binary_container_pipeline_data(
            user_params=user_params, pipeline_run_name=pipeline_run_name)

        logger.info("creating binary container image pipeline run: %s",
                    pipeline_run_name)

        pipeline_run = PipelineRun(self.os, pipeline_run_name,
                                   pipeline_run_data)

        try:
            logger.info("pipeline run created: %s",
                        pipeline_run.start_pipeline_run())
        except OsbsResponseException:
            logger.error("failed to create pipeline run %s", pipeline_run_name)
            raise

        return pipeline_run