How to use the taskcluster.fromNowJSON function in taskcluster

To help you get started, we’ve selected a few taskcluster examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github web-platform-tests / wpt / tools / ci / tc / decision.py View on Github external
def create_tc_task(event, task, taskgroup_id, depends_on_ids):
    command = build_full_command(event, task)
    task_id = taskcluster.slugId()
    task_data = {
        "taskGroupId": taskgroup_id,
        "created": taskcluster.fromNowJSON(""),
        "deadline": taskcluster.fromNowJSON(task["deadline"]),
        "provisionerId": task["provisionerId"],
        "schedulerId": task["schedulerId"],
        "workerType": task["workerType"],
        "metadata": {
            "name": task["name"],
            "description": task.get("description", ""),
            "owner": get_owner(event),
            "source": event["repository"]["clone_url"]
        },
        "payload": {
            "artifacts": task.get("artifacts"),
            "command": command,
            "image": task.get("image"),
            "maxRunTime": task.get("maxRunTime"),
            "env": task.get("env", {}),
github web-platform-tests / wpt / tools / ci / tc / decision.py View on Github external
def create_tc_task(event, task, taskgroup_id, depends_on_ids):
    command = build_full_command(event, task)
    task_id = taskcluster.slugId()
    task_data = {
        "taskGroupId": taskgroup_id,
        "created": taskcluster.fromNowJSON(""),
        "deadline": taskcluster.fromNowJSON(task["deadline"]),
        "provisionerId": task["provisionerId"],
        "schedulerId": task["schedulerId"],
        "workerType": task["workerType"],
        "metadata": {
            "name": task["name"],
            "description": task.get("description", ""),
            "owner": get_owner(event),
            "source": event["repository"]["clone_url"]
        },
        "payload": {
            "artifacts": task.get("artifacts"),
            "command": command,
            "image": task.get("image"),
            "maxRunTime": task.get("maxRunTime"),
            "env": task.get("env", {}),
        },
github web-platform-tests / wpt / tools / ci / decision.py View on Github external
def create_tc_task(event, task, required_task_ids):
    command = build_full_command(event, task)
    worker_type = ("wpt-docker-worker"
                   if event["repository"]["full_name"] == 'web-platform-tests/wpt'
                   else "github-worker")
    task_id = taskcluster.slugId()
    task_data = {
        "taskGroupId": "", # TODO
        "created": taskcluster.fromNowJSON(""),
        "deadline": taskcluster.fromNowJSON(task["deadline"]),
        "provisionerId": task["provisionerId"],
        "workerType": worker_type,
        "metadata": {
            "name": task["name"],
            "description": task.get("description", ""),
            "owner": "%s@users.noreply.github.com" % event["sender"]["login"],
            "source": event["repository"]["url"]
        },
        "payload": {
            "artifacts": task.get("artifacts"),
            "command": command,
            "image": task.get("image"),
            "maxRunTime": task.get("maxRunTime"),
            "env": task.get("env", []),
        },
github web-platform-tests / wpt / tools / ci / decision.py View on Github external
def create_tc_task(event, task, required_task_ids):
    command = build_full_command(event, task)
    worker_type = ("wpt-docker-worker"
                   if event["repository"]["full_name"] == 'web-platform-tests/wpt'
                   else "github-worker")
    task_id = taskcluster.slugId()
    task_data = {
        "taskGroupId": "", # TODO
        "created": taskcluster.fromNowJSON(""),
        "deadline": taskcluster.fromNowJSON(task["deadline"]),
        "provisionerId": task["provisionerId"],
        "workerType": worker_type,
        "metadata": {
            "name": task["name"],
            "description": task.get("description", ""),
            "owner": "%s@users.noreply.github.com" % event["sender"]["login"],
            "source": event["repository"]["url"]
        },
        "payload": {
            "artifacts": task.get("artifacts"),
            "command": command,
            "image": task.get("image"),
            "maxRunTime": task.get("maxRunTime"),
            "env": task.get("env", []),
        },
        "extras": {