bug 1442793 - generate_taskcluster_artifact_prefix. r=bhearsum

MozReview-Commit-ID: 2zRqm5C9ZZQ

--HG--
extra : rebase_source : 859141b77f0fc52e4d84d4b476354dc5689fcec9
This commit is contained in:
Aki Sasaki 2018-03-21 12:07:01 -07:00
Родитель e395d56806
Коммит 839bed1924
5 изменённых файлов: 16 добавлений и 10 удалений

Просмотреть файл

@ -25,7 +25,7 @@ def add_command(config, tasks):
if 'update-verify-config' in upstream:
final_verify_configs.append(
"{}update-verify.cfg".format(
get_taskcluster_artifact_prefix("<{}>".format(upstream))
get_taskcluster_artifact_prefix(task, "<{}>".format(upstream))
)
)
task["worker"]["command"] = [

Просмотреть файл

@ -88,7 +88,7 @@ def make_task_description(config, jobs):
extra = {'funsize': {'partials': list()}}
update_number = 1
artifact_path = "{}{}".format(
get_taskcluster_artifact_prefix(signing_task_ref, locale=locale),
get_taskcluster_artifact_prefix(dep_job, signing_task_ref, locale=locale),
'target.complete.mar'
)
for build in sorted(builds):

Просмотреть файл

@ -184,7 +184,7 @@ def make_job_description(config, jobs):
})
worker = {
'env': _generate_task_env(build_platform, build_task_ref,
'env': _generate_task_env(dep_job, build_platform, build_task_ref,
signing_task_ref, locale=locale),
'artifacts': _generate_task_output_files(build_platform, locale=locale),
'chain-of-trust': True,
@ -242,9 +242,11 @@ def make_job_description(config, jobs):
yield task
def _generate_task_env(build_platform, build_task_ref, signing_task_ref, locale=None):
mar_prefix = get_taskcluster_artifact_prefix(build_task_ref, postfix='host/bin/', locale=None)
signed_prefix = get_taskcluster_artifact_prefix(signing_task_ref, locale=locale)
def _generate_task_env(task, build_platform, build_task_ref, signing_task_ref, locale=None):
mar_prefix = get_taskcluster_artifact_prefix(
task, build_task_ref, postfix='host/bin/', locale=None
)
signed_prefix = get_taskcluster_artifact_prefix(task, signing_task_ref, locale=locale)
if build_platform.startswith('linux') or build_platform.startswith('macosx'):
tarball_extension = 'bz2' if build_platform.startswith('linux') else 'gz'

Просмотреть файл

@ -47,7 +47,7 @@ def add_command(config, tasks):
for upstream in chunked.get("dependencies", {}).keys():
if 'update-verify-config' in upstream:
update_verify_config = "{}update-verify.cfg".format(
get_taskcluster_artifact_prefix("<{}>".format(upstream))
get_taskcluster_artifact_prefix(task, "<{}>".format(upstream))
)
if not update_verify_config:
raise Exception("Couldn't find upate verify config")

Просмотреть файл

@ -17,7 +17,7 @@ from requests.adapters import HTTPAdapter
from taskgraph.task import Task
_TC_ARTIFACT_LOCATION = \
'https://queue.taskcluster.net/v1/task/{task_id}/artifacts/public/build/{postfix}'
'https://queue.taskcluster.net/v1/task/{task_id}/artifacts/{artifact_prefix}/{postfix}'
logger = logging.getLogger(__name__)
@ -209,8 +209,12 @@ def purge_cache(provisioner_id, worker_type, cache_name, use_proxy=False):
_do_request(purge_cache_url, json={'cacheName': cache_name})
def get_taskcluster_artifact_prefix(task_id, postfix='', locale=None):
def get_taskcluster_artifact_prefix(task, task_id, postfix='', locale=None):
if locale:
postfix = '{}/{}'.format(locale, postfix)
return _TC_ARTIFACT_LOCATION.format(task_id=task_id, postfix=postfix)
artifact_prefix = get_artifact_prefix(task)
return _TC_ARTIFACT_LOCATION.format(
task_id=task_id, postfix=postfix, artifact_prefix=artifact_prefix
)