mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Support both Taskcluster deployments
Part of https://bugzilla.mozilla.org/show_bug.cgi?id=1574648
This commit is contained in:
parent
5abb013dfd
commit
d8b630779d
4 changed files with 35 additions and 9 deletions
|
@ -8,7 +8,10 @@ policy:
|
|||
tasks:
|
||||
$let:
|
||||
task_common:
|
||||
provisionerId: aws-provisioner-v1
|
||||
provisionerId:
|
||||
$if: "taskcluster_root_url == 'https://taskcluster.net'"
|
||||
then: aws-provisioner-v1
|
||||
else: proj-servo
|
||||
created: {$fromNow: ''}
|
||||
deadline: {$fromNow: '1 day'}
|
||||
extra:
|
||||
|
@ -53,7 +56,10 @@ tasks:
|
|||
description: ""
|
||||
owner: ${event.pusher.name}@users.noreply.github.com
|
||||
source: ${event.compare}
|
||||
workerType: servo-docker-worker
|
||||
workerType:
|
||||
$if: "taskcluster_root_url == 'https://taskcluster.net'"
|
||||
then: servo-docker-worker
|
||||
else: docker
|
||||
scopes:
|
||||
- "assume:repo:github.com/servo/servo:branch:${branch}"
|
||||
routes:
|
||||
|
@ -82,7 +88,10 @@ tasks:
|
|||
description: ""
|
||||
owner: ${event.sender.login}@users.noreply.github.com
|
||||
source: ${event.pull_request.url}
|
||||
workerType: servo-docker-untrusted
|
||||
workerType:
|
||||
$if: "taskcluster_root_url == 'https://taskcluster.net'"
|
||||
then: servo-docker-untrusted
|
||||
else: docker-untrusted
|
||||
scopes:
|
||||
- "assume:repo:github.com/servo/servo:pull-request"
|
||||
routes:
|
||||
|
|
|
@ -157,7 +157,9 @@ windows_sparse_checkout = [
|
|||
def linux_tidy_unit_untrusted():
|
||||
return (
|
||||
decisionlib.DockerWorkerTask("Tidy + dev build + unit tests")
|
||||
.with_worker_type("servo-docker-untrusted")
|
||||
.with_worker_type(
|
||||
"servo-docker-untrusted" if CONFIG.legacy_tc_deployment else "docker-untrusted"
|
||||
)
|
||||
.with_treeherder("Linux x64", "Tidy+Unit")
|
||||
.with_max_run_time_minutes(60)
|
||||
.with_dockerfile(dockerfile_path("build"))
|
||||
|
@ -731,7 +733,7 @@ def dockerfile_path(name):
|
|||
def linux_task(name):
|
||||
return (
|
||||
decisionlib.DockerWorkerTask(name)
|
||||
.with_worker_type("servo-docker-worker")
|
||||
.with_worker_type("servo-docker-worker" if CONFIG.legacy_tc_deployment else "docker")
|
||||
.with_treeherder_required()
|
||||
)
|
||||
|
||||
|
@ -739,7 +741,7 @@ def linux_task(name):
|
|||
def windows_task(name):
|
||||
return (
|
||||
decisionlib.WindowsGenericWorkerTask(name)
|
||||
.with_worker_type("servo-win2016")
|
||||
.with_worker_type("servo-win2016" if CONFIG.legacy_tc_deployment else "win2016")
|
||||
.with_treeherder_required()
|
||||
)
|
||||
|
||||
|
@ -968,10 +970,15 @@ def magicleap_nightly():
|
|||
|
||||
|
||||
CONFIG.task_name_template = "Servo: %s"
|
||||
CONFIG.index_prefix = "project.servo.servo"
|
||||
CONFIG.docker_image_build_worker_type = "servo-docker-worker"
|
||||
CONFIG.docker_images_expire_in = build_dependencies_artifacts_expire_in
|
||||
CONFIG.repacked_msi_files_expire_in = build_dependencies_artifacts_expire_in
|
||||
if CONFIG.legacy_tc_deployment:
|
||||
CONFIG.index_prefix = "project.servo.servo"
|
||||
CONFIG.docker_image_build_worker_type = "servo-docker-worker"
|
||||
else: # pragma: no cover
|
||||
CONFIG.index_prefix = "project.servo"
|
||||
CONFIG.default_provisioner_id = "proj-servo"
|
||||
CONFIG.docker_image_build_worker_type = "docker"
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
|
|
|
@ -57,6 +57,15 @@ class Config:
|
|||
self.git_ref = os.environ.get("GIT_REF")
|
||||
self.git_sha = os.environ.get("GIT_SHA")
|
||||
|
||||
root_url = os.environ.get("TASKCLUSTER_ROOT_URL")
|
||||
self.legacy_tc_deployment = root_url == "https://taskcluster.net"
|
||||
|
||||
if self.legacy_tc_deployment:
|
||||
self.default_provisioner_id = "aws-provisioner-v1"
|
||||
else: # pragma: no cover
|
||||
self.default_provisioner_id = "proj-example"
|
||||
|
||||
|
||||
def task_id(self):
|
||||
if hasattr(self, "_task_id"):
|
||||
return self._task_id
|
||||
|
@ -131,7 +140,7 @@ class Task:
|
|||
self.name = name
|
||||
self.description = ""
|
||||
self.scheduler_id = "taskcluster-github"
|
||||
self.provisioner_id = "aws-provisioner-v1"
|
||||
self.provisioner_id = CONFIG.default_provisioner_id
|
||||
self.worker_type = "github-worker"
|
||||
self.deadline_in = "1 day"
|
||||
self.expires_in = "1 year"
|
||||
|
|
|
@ -44,6 +44,7 @@ sys.modules["taskcluster"] = sys.modules[__name__]
|
|||
sys.dont_write_bytecode = True
|
||||
os.environ.update(**{k: k for k in "TASK_ID TASK_OWNER TASK_SOURCE GIT_URL GIT_SHA".split()})
|
||||
os.environ["GIT_REF"] = "refs/heads/auto"
|
||||
os.environ["TASKCLUSTER_ROOT_URL"] = "https://taskcluster.net"
|
||||
import decision_task
|
||||
|
||||
print("\n# Push:")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue