Skip to content

Commit b1ed47d

Browse files
committed
NO-JIRA: chore(.tekton): remove dead code in konflux_generate_component_build_pipelines.py
1 parent fe43b80 commit b1ed47d

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

ci/cached-builds/konflux_generate_component_build_pipelines.py

+3-55
Original file line numberDiff line numberDiff line change
@@ -52,57 +52,7 @@ def bundle_task_ref(name) -> dict:
5252
}
5353

5454

55-
def build_container(
56-
name_suffix: str = "",
57-
output_image: str = "$(params.output-image)",
58-
dockerfile: str = "$(params.dockerfile)",
59-
run_after: str = "prefetch-dependencies",
60-
build_arg: str = "$(params.build-args[*])") -> dict:
61-
"""Returns a build-container step definition for the Konflux pipeline."""
62-
return {
63-
"name": "build-container" + name_suffix,
64-
"params": [
65-
{"name": "IMAGE", "value": output_image},
66-
{"name": "DOCKERFILE", "value": dockerfile},
67-
{"name": "CONTEXT", "value": "$(params.path-context)"},
68-
{"name": "HERMETIC", "value": "$(params.hermetic)"},
69-
{"name": "PREFETCH_INPUT", "value": "$(params.prefetch-input)"},
70-
{
71-
"name": "IMAGE_EXPIRES_AFTER",
72-
"value": "$(params.image-expires-after)",
73-
},
74-
{
75-
"name": "COMMIT_SHA",
76-
"value": "$(tasks.clone-repository.results.commit)",
77-
},
78-
{"name": "BUILD_ARGS", "value": [build_arg]},
79-
{
80-
"name": "BUILD_ARGS_FILE",
81-
"value": ["$(params.build-args-file)"],
82-
},
83-
{
84-
"name": "SOURCE_ARTIFACT",
85-
"value": "$(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)",
86-
},
87-
{
88-
"name": "CACHI2_ARTIFACT",
89-
"value": "$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)",
90-
},
91-
],
92-
"runAfter": [run_after],
93-
"taskRef": bundle_task_ref("buildah-remote-oci-ta"),
94-
"when": [
95-
{
96-
"input": "$(tasks.init.results.build)",
97-
"operator": "in",
98-
"values": ["true"],
99-
}
100-
],
101-
}
102-
103-
104-
def component_build_pipeline(component_name, dockerfile_path,
105-
build_container_tasks: list[dict], is_pr: bool = True) -> dict:
55+
def component_build_pipeline(component_name, dockerfile_path, is_pr: bool = True) -> dict:
10656
"""Returns a component build pipeline definition.
10757
10858
This is general enough to create PR pipeline as well as push pipeline.
@@ -799,16 +749,14 @@ def main():
799749
print("# yamllint disable-file", file=yaml_file)
800750
print("# This file is autogenerated by ci/cached-builds/konflux_generate_component_build_pipelines.py",
801751
file=yaml_file)
802-
print(yaml.dump(component_build_pipeline(component_name=task_name, dockerfile_path=dockerfile,
803-
build_container_tasks=[build_container()], is_pr=False)),
752+
print(yaml.dump(component_build_pipeline(component_name=task_name, dockerfile_path=dockerfile, is_pr=False)),
804753
end="",
805754
file=yaml_file)
806755
with open(ROOT_DIR / ".tekton" / (task_name + "-pull-request.yaml"), "w") as yaml_file:
807756
print("# yamllint disable-file", file=yaml_file)
808757
print("# This file is autogenerated by ci/cached-builds/konflux_generate_component_build_pipelines.py",
809758
file=yaml_file)
810-
print(yaml.dump(component_build_pipeline(component_name=task_name, dockerfile_path=dockerfile,
811-
build_container_tasks=[build_container()], is_pr=True)),
759+
print(yaml.dump(component_build_pipeline(component_name=task_name, dockerfile_path=dockerfile, is_pr=True)),
812760
end="",
813761
file=yaml_file)
814762

0 commit comments

Comments
 (0)