fix: Make containerfile formatting nicer

This commit is contained in:
Gerald Pinder 2023-12-16 16:08:28 -05:00
parent ea6143c7f7
commit 49d512b3f1

View file

@ -27,26 +27,26 @@ ARG CONFIG_DIRECTORY="/tmp/config"
ARG IMAGE_NAME="{{ name }}" ARG IMAGE_NAME="{{ name }}"
ARG BASE_IMAGE="{{ base_image }}" ARG BASE_IMAGE="{{ base_image }}"
{% macro run_modules(module) %} {%- macro run_modules(module) %}
{% if module.type %} {%- if module.type %}
{% if module.type == "containerfile" %} {%- if module.type == "containerfile" %}
{% for c in module.containerfiles %} {%- for c in module.containerfiles %}
{{ print_containerfile(containerfile = c ) }} {{ print_containerfile(containerfile = c ) }}
{% endfor %} {%- endfor %}
{% else %} {%- else %}
RUN chmod +x /tmp/modules/{{ module.type }}/{{ module.type }}.sh RUN chmod +x /tmp/modules/{{ module.type }}/{{ module.type }}.sh
RUN source /tmp/exports.sh && OS_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)" /tmp/modules/{{ module.type }}/{{ module.type }}.sh '{{ print_module_context(module = module) }}' RUN source /tmp/exports.sh && OS_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)" /tmp/modules/{{ module.type }}/{{ module.type }}.sh '{{ print_module_context(module = module) }}'
{% endif %} {%- endif %}
{% elif module["from-file"] %} {%- elif module["from-file"] %}
{% set extra_module = get_module_from_file(file = module["from-file"]) %} {%- set extra_module = get_module_from_file(file = module["from-file"]) %}
{% for m in extra_module.modules %} {%- for m in extra_module.modules %}
{{ self::run_modules(module = m) }} {{ self::run_modules(module = m) }}
{% endfor %} {%- endfor %}
{% endif %} {%- endif %}
{% endmacro run_modules %} {%- endmacro run_modules %}
{% for module in modules %} {%- for module in modules %}
{{ self::run_modules(module = module) }} {{ self::run_modules(module = module) }}
{% endfor %} {%- endfor %}
RUN rm -rf /tmp/* /var/* && ostree container commit RUN rm -rf /tmp/* /var/* && ostree container commit