in gdk_build.py [0:0]
def create_recipe():
""" Creates the component recipe, filling in the Docker images and Secret ARN """
print('Creating recipe {}'.format(FILE_RECIPE))
with open(FILE_DOCKER_COMPOSE, encoding="utf-8") as docker_compose_file:
docker_compose_yaml = yaml.safe_load(docker_compose_file)
with open(FILE_RECIPE_TEMPLATE, encoding="utf-8") as recipe_template_file:
recipe_str = recipe_template_file.read()
recipe_str = recipe_str.replace('$SECRET_ARN', secret_value['ARN'])
recipe_str = recipe_str.replace('$DOCKER_IMAGE', docker_compose_yaml['services']['homeassistant']['image'])
recipe_json = json.loads(recipe_str)
recipe_str = json.dumps(recipe_json, indent=2)
with open(FILE_RECIPE, 'w', encoding="utf-8") as recipe_file:
recipe_file.write(recipe_str)
print('Created recipe')