fix: Put export script in own image

HEREDOC support for podman doesn't work exactly 1-1 with Dockerfiles. This fix gives the export script its own image that we mount.
This commit is contained in:
Gerald Pinder 2024-03-27 00:08:58 -04:00
parent ae9c3ef83a
commit 19c93ce742
9 changed files with 29 additions and 28 deletions

View file

@ -27,15 +27,14 @@ RUN \
{%- 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=bind,from=ghcr.io/blue-build/cli/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 \
/bin/bash -c " \
echo '========== Start {{ type|capitalize }} module ==========' \
&& chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \
&& source /tmp/exports.sh \
&& /tmp/modules/{{ type }}/{{ type }}.sh '{{ module.print_module_context() }}' \
&& echo '========== End {{ type|capitalize }} module ==========' \
&& ostree container commit"
echo "========== Start {{ type|capitalize }} module ==========" \
&& chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \
&& source /tmp/exports.sh \
&& /tmp/modules/{{ type }}/{{ type }}.sh '{{ module.print_module_context() }}' \
&& echo "========== End {{ type|capitalize }} module ==========" \
&& ostree container commit
{%- endif %}
{%- endif %}
{%- endfor %}