Support both Taskcluster deployments

Part of https://bugzilla.mozilla.org/show_bug.cgi?id=1574648
This commit is contained in:
Simon Sapin 2019-11-03 15:08:44 +01:00
parent 5abb013dfd
commit d8b630779d
4 changed files with 35 additions and 9 deletions

View file

@ -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"