Skip to content

Commit 1f6c54c

Browse files
committed
feat: Make docker image artifact paths configurable (bug 1989274)
1 parent 3e5cab8 commit 1f6c54c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/taskgraph/transforms/docker_image.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from taskgraph.transforms.base import TransformSequence
1414
from taskgraph.util import json
1515
from taskgraph.util.docker import create_context_tar, generate_context_hash
16+
from taskgraph.util.taskcluster import get_artifact_prefix_from_parameters
1617
from taskgraph.util.schema import Schema
1718

1819
from .task import task_description_schema
@@ -143,6 +144,8 @@ def fill_template(config, tasks):
143144
f"Missing package job for {config.kind}-{image_name}: {p}"
144145
)
145146

147+
artifact_prefix = get_artifact_prefix_from_parameters(config.params)
148+
146149
if not taskgraph.fast:
147150
context_path = os.path.join("taskcluster", "docker", definition)
148151
topsrcdir = os.path.dirname(config.graph_config.taskcluster_yml)
@@ -199,12 +202,12 @@ def fill_template(config, tasks):
199202
{
200203
"type": "file",
201204
"path": "/workspace/image.tar.zst",
202-
"name": "public/image.tar.zst",
205+
"name": f"{artifact_prefix}/image.tar.zst",
203206
}
204207
],
205208
"env": {
206209
"CONTEXT_TASK_ID": {"task-reference": "<decision>"},
207-
"CONTEXT_PATH": f"public/docker-contexts/{image_name}.tar.gz",
210+
"CONTEXT_PATH": f"{artifact_prefix}/docker-contexts/{image_name}.tar.gz",
208211
"HASH": context_hash,
209212
"PROJECT": config.params["project"],
210213
"IMAGE_NAME": image_name,

0 commit comments

Comments
 (0)