44from tempfile import mkdtemp
55from typing import Optional
66
7- import jinja2
87import typer
98
109from epics_containers_cli .globals import BEAMLINE_CHART_FOLDER , CONFIG_FOLDER
@@ -42,7 +41,6 @@ def __init__(
4241 self .tmp = Path (mkdtemp ())
4342
4443 self .bl_chart_folder = self .tmp / BEAMLINE_CHART_FOLDER
45- self .jinja_path = self .bl_chart_folder / "Chart.yaml.jinja"
4644 self .bl_chart_path = self .bl_chart_folder / "Chart.yaml"
4745 self .bl_config_folder = self .bl_chart_folder / CONFIG_FOLDER
4846
@@ -92,17 +90,12 @@ def deploy(self):
9290
9391 def _do_deploy (self , config_folder : Path ):
9492 """
95- Generate an on the fly chart using beamline chart with config folder
96- and generated Chart.yaml. Deploy the resulting helm chart to the cluster.
93+ Generate an on the fly chart using beamline chart with config folder.
94+ Deploy the resulting helm chart to the cluster.
9795 """
9896 # values.yaml is a peer to the config folder
9997 values_path = config_folder .parent / "values.yaml"
10098
101- # render a Chart.yaml from the jinja template
102- template = jinja2 .Template (self .jinja_path .read_text ())
103- chart = template .render (ioc_name = self .ioc_name , ioc_version = self .version )
104- self .bl_chart_path .write_text (chart )
105-
10699 # add the config folder to the helm chart
107100 self .bl_config_folder .symlink_to (config_folder )
108101
@@ -124,7 +117,8 @@ def _install(
124117 cmd = (
125118 f"bash -c "
126119 f'"helm { helm_cmd } { self .ioc_name } { self .bl_chart_folder } '
127- f"--version { self .version } --namespace { self .namespace } -f { values } "
120+ f"--version { self .version } --namespace { self .namespace } -f { values } "
121+ f"--set ioc_name={ self .ioc_name } --set ioc_version={ self .version } "
128122 f" 2> >(grep -v 'found symbolic link' >&2)\" "
129123 )
130124 if self .args :
0 commit comments