diff options
Diffstat (limited to 'etc/taskcluster/decisionlib.py')
-rw-r--r-- | etc/taskcluster/decisionlib.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index 6ba349e8d0d..b729c9c369c 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -173,6 +173,22 @@ class Task: self.treeherder_required = False # Taken care of return self + def with_s3_upload_secret(self): + return ( + self + .with_scopes("secrets:get:project/servo/s3-upload") + .with_env(PY=r"""if 1: + import urllib, json + url = "http://taskcluster/secrets/v1/secret/project/servo/s3-upload" + secret = json.load(urllib.urlopen(url))["secret"] + open("/root/.aws/credentials", "w").write(secret["credentials_file"]) + """) + .with_script(""" + mkdir /root/.aws + python -c "$PY" + """) + ) + def build_worker_payload(self): # pragma: no cover """ Overridden by sub-classes to return a dictionary in a worker-specific format, |