mirror of
https://github.com/servo/servo.git
synced 2025-07-03 21:43:41 +01:00
48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
# coding: utf8
|
|
|
|
import os
|
|
import datetime
|
|
import taskcluster
|
|
|
|
task_id = taskcluster.slugId()
|
|
payload = {
|
|
"taskGroupId": os.environ["DECISION_TASK_ID"],
|
|
"dependencies": [os.environ["DECISION_TASK_ID"]],
|
|
"schedulerId": "taskcluster-github", # FIXME: can we avoid hard-coding this?
|
|
"provisionerId": "aws-provisioner-v1",
|
|
"workerType": "github-worker",
|
|
"created": taskcluster.fromNowJSON(""),
|
|
"deadline": taskcluster.fromNowJSON("1 hour"),
|
|
"metadata": {
|
|
"name": "Taskcluster experiments for Servo: Child task",
|
|
"description": "",
|
|
"owner": os.environ["DECISION_TASK_OWNER"],
|
|
"source": os.environ["DECISION_TASK_SOURCE"],
|
|
},
|
|
"payload": {
|
|
"maxRunTime": 600,
|
|
"image": "buildpack-deps:bionic",
|
|
"command": [
|
|
"/bin/bash",
|
|
"--login",
|
|
"-c",
|
|
"""
|
|
git clone %(DECISION_TASK_CLONE_URL)s repo &&
|
|
cd repo &&
|
|
git checkout %(DECISION_TASK_COMMIT_SHA)s &&
|
|
./child-task.sh
|
|
""" % os.environ,
|
|
],
|
|
"artifacts": {
|
|
"public/executable.gz": {
|
|
"type": "file",
|
|
"path": "/repo/something-rust/something-rust.gz",
|
|
"expires": taskcluster.fromNowJSON("1 week"),
|
|
},
|
|
},
|
|
},
|
|
}
|
|
# https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/features#feature-taskclusterproxy
|
|
queue = taskcluster.Queue(options={"baseUrl": "http://taskcluster/queue/v1/"})
|
|
result = queue.createTask(task_id, payload)
|
|
print("task %s created…? %r" % (task_id, result))
|