mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1274645: generate task labels for docker image builds; r=ahal
This monkey-patches the old taskcluster_graph code to avoid impacting branches that are still using that support for decision graphs. All of this will go away when docker image builds become their own kind. MozReview-Commit-ID: KukC3qqZDYA --HG-- extra : rebase_source : 7bc4e89ad586120fdea78dfd7539633014ccc300 extra : source : 5e8b6de669628bf838432b93d1e1cff783b7ff62
This commit is contained in:
parent
22462c932f
commit
d99040fe43
@ -59,6 +59,10 @@ logger = logging.getLogger(__name__)
|
||||
def mklabel():
|
||||
return TASKID_PLACEHOLDER.format(slugid())
|
||||
|
||||
# monkey-patch mklabel into image_builder, as well
|
||||
from taskcluster_graph import image_builder
|
||||
image_builder.mklabel = mklabel
|
||||
|
||||
def set_expiration(task, timestamp):
|
||||
task_def = task['task']
|
||||
task_def['expires'] = timestamp
|
||||
|
@ -22,6 +22,12 @@ DEFINE_TASK = 'queue:define-task:aws-provisioner-v1/{}'
|
||||
def is_docker_registry_image(registry_path):
|
||||
return os.path.isfile(registry_path)
|
||||
|
||||
# make a task label; in old decision tasks, this is a regular slugid, but when called
|
||||
# from the taskgraph generator's legacy kind, this is monkey-patched to return a label
|
||||
# (`TaskLabel==..`)
|
||||
def mklabel():
|
||||
return slugid()
|
||||
|
||||
def docker_image(name):
|
||||
''' Determine the docker tag/revision from an in tree docker file '''
|
||||
repository_path = os.path.join(DOCKER_ROOT, name, 'REGISTRY')
|
||||
@ -49,7 +55,7 @@ def task_id_for_image(seen_images, project, name, create=True):
|
||||
if not create:
|
||||
return None
|
||||
|
||||
task_id = slugid()
|
||||
task_id = mklabel()
|
||||
seen_images[name] = {
|
||||
'taskId': task_id,
|
||||
'path': context_path,
|
||||
|
Loading…
Reference in New Issue
Block a user