refactor: Move templates to their own crate (#83)
This PR logically separates out parts of the code to their own crates. This will be useful for future Tauri App development.
This commit is contained in:
parent
ce8f889dc2
commit
910e0434b6
34 changed files with 620 additions and 512 deletions
29
template/templates/modules/modules.j2
Normal file
29
template/templates/modules/modules.j2
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{%- for module in recipe.modules_ext.modules %}
|
||||
{%- if let Some(type) = module.module_type %}
|
||||
{%- if type == "containerfile" %}
|
||||
{%- include "modules/containerfile/containerfile.j2" %}
|
||||
{%- else if type == "files" %}
|
||||
{%- include "modules/files/files.j2" %}
|
||||
{%- else %}
|
||||
RUN \
|
||||
--mount=type=tmpfs,target=/tmp \
|
||||
--mount=type=tmpfs,target=/var \
|
||||
--mount=type=bind,from=docker.io/mikefarah/yq,src=/usr/bin/yq,dst=/usr/bin/yq \
|
||||
--mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw \
|
||||
{%- if let Some(source) = module.source %}
|
||||
--mount=type=bind,from={{ source }},src=/modules,dst=/tmp/modules,rw \
|
||||
{%- else %}
|
||||
--mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \
|
||||
{%- endif %}
|
||||
{%- if type == "akmods" %}
|
||||
--mount=type=bind,from=stage-akmods-{{ module.generate_akmods_info(os_version).stage_name }},src=/rpms,dst=/tmp/rpms,rw \
|
||||
{%- endif %}
|
||||
--mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \
|
||||
--mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }},sharing=locked \
|
||||
chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \
|
||||
&& source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ module.print_module_context() }}'
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue