refactor: Use askama crate for compile-time template type checking
This commit is contained in:
parent
039c5f9659
commit
d663b7574b
9 changed files with 364 additions and 778 deletions
17
templates/Containerfile.module
Normal file
17
templates/Containerfile.module
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{%- for module in modules %}
|
||||
{%- if let Some(type) = module.module_type %}
|
||||
{%- if type == "containerfile" %}
|
||||
{%- if let Some(containerfiles) = self::get_containerfile_list(module) %}
|
||||
{%- for c in containerfiles %}
|
||||
{{ self::print_containerfile(c) }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- else %}
|
||||
RUN chmod +x /tmp/modules/{{ type }}/{{ type }}.sh && source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}'
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if let Some(from_file) = module.from_file %}
|
||||
{{ self::get_module_from_file(from_file).render().unwrap() }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue