Skip to content

Commit

Permalink
Bug 1405408 - Part 2: Add taskcluster-proxy and scopes to tasks consu…
Browse files Browse the repository at this point in the history
…ming non-public/ toolchains. r=dustin

MozReview-Commit-ID: BIGjLXmTSli

--HG--
extra : rebase_source : 8628be21bacacbd782dffc47933d000c57dc2fb2
  • Loading branch information
ncalexan committed Oct 5, 2017
1 parent 68f1512 commit 138188e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion taskcluster/taskgraph/transforms/use_toolchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_alias(key):
return aliases.get(key, key)

for job in jobs:
scopes = job.setdefault('scopes', [])
env = job.setdefault('worker', {}).setdefault('env', {})

toolchains = [get_alias(t)
Expand All @@ -83,7 +84,7 @@ def get_alias(key):
raise Exception('Missing toolchain job for %s-%s: %s'
% (config.kind, job['name'], t))

f = os.path.basename(artifacts[t])
dirname, f = os.path.split(artifacts[t])
if f in filenames:
# Build jobs don't support toolchain artifacts with the same
# name: they would overwrite one with the other.
Expand All @@ -93,6 +94,15 @@ def get_alias(key):
t, f))
filenames[f] = t

if not artifacts[t].startswith('public/'):
# Use taskcluster-proxy and request appropriate scope.
# For example, add 'scopes: [queue:get-artifact:path/to/*]'
# for 'path/to/artifact.tar.xz'.
job['worker']['taskcluster-proxy'] = True
scope = 'queue:get-artifact:{}/*'.format(dirname)
if scope not in scopes:
scopes.append(scope)

if t.endswith('-sccache'):
job['needs-sccache'] = True

Expand Down

0 comments on commit 138188e

Please sign in to comment.