mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Support features in generic-worker tasks.
This commit is contained in:
parent
7e139db97d
commit
e2d994b354
1 changed files with 13 additions and 2 deletions
|
@ -286,6 +286,7 @@ class GenericWorkerTask(Task):
|
|||
super().__init__(*args, **kwargs)
|
||||
self.max_run_time_minutes = 30
|
||||
self.env = {}
|
||||
self.features = {}
|
||||
self.mounts = []
|
||||
self.artifacts = []
|
||||
|
||||
|
@ -314,6 +315,7 @@ class GenericWorkerTask(Task):
|
|||
worker_payload,
|
||||
env=self.env,
|
||||
mounts=self.mounts,
|
||||
features=self.features,
|
||||
artifacts=[
|
||||
{
|
||||
"type": type_,
|
||||
|
@ -337,6 +339,15 @@ class GenericWorkerTask(Task):
|
|||
self.artifacts.extend((type, path) for path in paths)
|
||||
return self
|
||||
|
||||
def with_features(self, *names):
|
||||
"""
|
||||
Enable the given `generic-worker` features.
|
||||
|
||||
<https://github.com/taskcluster/generic-worker/blob/master/native_windows.yml>
|
||||
"""
|
||||
self.features.update({name: True for name in names})
|
||||
return self
|
||||
|
||||
def _mount_content(self, url_or_artifact_name, task_id, sha256):
|
||||
if task_id:
|
||||
content = {"taskId": task_id, "artifact": url_or_artifact_name}
|
||||
|
@ -693,9 +704,9 @@ class DockerWorkerTask(UnixTaskMixin, Task):
|
|||
|
||||
def with_features(self, *names):
|
||||
"""
|
||||
Enable the give `docker-worker` features.
|
||||
Enable the given `docker-worker` features.
|
||||
|
||||
<https://docs.taskcluster.net/docs/reference/workers/docker-worker/docs/features>
|
||||
<https://github.com/taskcluster/docker-worker/blob/master/docs/features.md>
|
||||
"""
|
||||
self.features.update({name: True for name in names})
|
||||
return self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue