Exemple #1
0
    def trigger_workflow(self, trigger_id, commit_sha='',
                         status_url=None, collab_url=None, workflow=None):
        """Get trigger by trigger id and start git workflow associated."""
        # Note: self.context will be None at this point as this is a
        # non-authenticated request.
        plan_obj = objects.registry.Plan.get_by_trigger_id(None, trigger_id)
        # get the trust context and authenticate it.
        try:
            self.context = keystone_utils.create_delegation_context(
                plan_obj, self.context)
            self.context.tenant = plan_obj.project_id
            self.context.user = plan_obj.user_id
            self.context.user_name = plan_obj.username

        except exception.AuthorizationFailure as auth_ex:
            LOG.warn(auth_ex)
            return

        artifacts = plan_obj.raw_content.get('artifacts', [])
        for arti in artifacts:
            if repo_utils.verify_artifact(arti, collab_url):
                self._build_artifact(plan_obj, artifact=arti,
                                     commit_sha=commit_sha,
                                     status_url=status_url,
                                     workflow=workflow)
Exemple #2
0
    def trigger_workflow(self, trigger_id, commit_sha='',
                         status_url=None, collab_url=None, workflow=None):
        """Get trigger by trigger id and start git workflow associated."""
        # Note: self.context will be None at this point as this is a
        # non-authenticated request.
        plan_obj = objects.registry.Plan.get_by_trigger_id(None, trigger_id)
        # get the trust context and authenticate it.
        try:
            self.context = keystone_utils.create_delegation_context(
                plan_obj, self.context)
            self.context.tenant = plan_obj.project_id
            self.context.user = plan_obj.user_id
            self.context.user_name = plan_obj.username

        except exception.AuthorizationFailure as auth_ex:
            LOG.warning(auth_ex)
            return

        artifacts = plan_obj.raw_content.get('artifacts', [])
        for arti in artifacts:
            if repo_utils.verify_artifact(arti, collab_url):
                self._build_artifact(plan_obj, artifact=arti,
                                     commit_sha=commit_sha,
                                     status_url=status_url,
                                     workflow=workflow)
    def trigger_workflow(self,
                         trigger_id,
                         commit_sha='',
                         status_url=None,
                         collab_url=None):
        """Get trigger by trigger id and start git workflow associated."""
        # Note: self.context will be None at this point as this is a
        # non-authenticated request.
        db_obj = objects.registry.Assembly.get_by_trigger_id(None, trigger_id)
        try:
            # get the trust\impersonation context and authenticate it.
            self.context = keystone_utils.create_delegation_context(
                db_obj, self.context)
        except exception.AuthorizationFailure as auth_ex:
            LOG.warning(auth_ex)
            return

        plan_obj = objects.registry.Plan.get_by_id(self.context,
                                                   db_obj.plan_id)

        artifacts = plan_obj.raw_content.get('artifacts', [])
        for arti in artifacts:
            if repo_utils.verify_artifact(arti, collab_url):
                self._build_artifact(assem=db_obj,
                                     artifact=arti,
                                     commit_sha=commit_sha,
                                     status_url=status_url)
Exemple #4
0
    def trigger_workflow(self, trigger_id, commit_sha='',
                         status_url=None, collab_url=None):
        """Get trigger by trigger id and start git workflow associated."""
        # Note: self.context will be None at this point as this is a
        # non-authenticated request.
        db_obj = objects.registry.Assembly.get_by_trigger_id(None,
                                                             trigger_id)
        try:
            # get the trust\impersonation context and authenticate it.
            self.context = keystone_utils.create_delegation_context(
                db_obj, self.context)
        except exception.AuthorizationFailure as auth_ex:
            LOG.warning(auth_ex)
            return

        plan_obj = objects.registry.Plan.get_by_id(self.context,
                                                   db_obj.plan_id)

        artifacts = plan_obj.raw_content.get('artifacts', [])
        for arti in artifacts:
            if repo_utils.verify_artifact(arti, collab_url):
                self._build_artifact(assem=db_obj, artifact=arti,
                                     commit_sha=commit_sha,
                                     status_url=status_url)