def bootstrap(self): """Information related to the build image.""" images_config = self.container_config['images'] bootstrap_recipe = None if self.bootstrap_image: config_args = _spack_checkout_config(images_config) command = checkout_command(*config_args) template_path = bootstrap_template_for(self.operating_system_key) env = tengine.make_environment() context = {"bootstrap": { "image": self.bootstrap_image, "spack_checkout": command }} bootstrap_recipe = env.get_template(template_path).render(**context) Bootstrap = collections.namedtuple('Bootstrap', ['image', 'recipe']) return Bootstrap(image=self.bootstrap_image, recipe=bootstrap_recipe)
def __call__(self): """Returns the recipe as a string""" env = tengine.make_environment() t = env.get_template(self.template_name) return t.render(**self.to_dict())