Develop and modify the SparkGen-AWS cookiecutter template — variables, hooks, files
Guide template development for the SparkGen-AWS cookiecutter.
Before any action:
cookiecutter.json for current variableshooks/post_gen_project.py for post-generation logic{{cookiecutter.project_slug}}/ for template structure/sparkgen-template-dev add-variable <name> <default> [choices])cookiecutter.json:
"<name>": "<default>""<name>": ["<default>", "<option2>", ...]"_<section>_section": "=== Section Name ==="{{ cookiecutter.<name> }}hooks/post_gen_project.pybash test_cookiecutter_matrix.sh/sparkgen-template-dev add-hook <description>)Add conditional logic to hooks/post_gen_project.py:
remove_file(path) to remove files based on cookiecutter choicesremove_dir(path) to remove directoriesif "{{ cookiecutter.var_name }}" == "value": remove_file/dir(...)/sparkgen-template-dev update-template <file-path>)When editing files inside {{cookiecutter.project_slug}}/:
CRITICAL: Jinja2 Escaping Rules
{{ cookiecutter.* }} — renders the cookiecutter variable (DO NOT wrap){{ any_other_var }} — MUST wrap in {% raw %}...{% endraw %}${{ github.* }} in GitHub Actions — MUST wrap in {% raw %}...{% endraw %}{% raw %}...{% endraw %}Examples:
# Cookiecutter var (renders at generation time) — NO wrapping