Exemplo n.º 1
0
    def action_callback(self, **options):
        from taskgraph.actions import trigger_action_callback
        from taskgraph.actions.util import get_parameters
        try:
            self.setup_logging()

            # the target task for this action (or null if it's a group action)
            task_id = json.loads(os.environ.get('ACTION_TASK_ID', 'null'))
            # the target task group for this action
            task_group_id = os.environ.get('ACTION_TASK_GROUP_ID', None)
            input = json.loads(os.environ.get('ACTION_INPUT', 'null'))
            callback = os.environ.get('ACTION_CALLBACK', None)
            root = options['root']

            parameters = get_parameters(task_group_id)

            return trigger_action_callback(task_group_id=task_group_id,
                                           task_id=task_id,
                                           input=input,
                                           callback=callback,
                                           parameters=parameters,
                                           root=root,
                                           test=False)
        except Exception:
            traceback.print_exc()
            sys.exit(1)
Exemplo n.º 2
0
def action_callback(options):
    from taskgraph.actions import trigger_action_callback
    from taskgraph.actions.util import get_parameters

    try:
        # the target task for this action (or null if it's a group action)
        task_id = json.loads(os.environ.get("ACTION_TASK_ID", "null"))
        # the target task group for this action
        task_group_id = os.environ.get("ACTION_TASK_GROUP_ID", None)
        input = json.loads(os.environ.get("ACTION_INPUT", "null"))
        callback = os.environ.get("ACTION_CALLBACK", None)
        root = options["root"]

        parameters = get_parameters(task_group_id)

        return trigger_action_callback(
            task_group_id=task_group_id,
            task_id=task_id,
            input=input,
            callback=callback,
            parameters=parameters,
            root=root,
            test=False,
        )
    except Exception:
        traceback.print_exc()
        sys.exit(1)