feat: Add support for NuShell scripts
This commit is contained in:
parent
1889bd9984
commit
74bd05643f
13 changed files with 115 additions and 16 deletions
|
|
@ -35,6 +35,16 @@ RUN --mount=type=bind,from=stage-bins,src=/bins,dst=/tmp/bins \
|
|||
&& cp /tmp/bins/* /usr/bin/ \
|
||||
&& ostree container commit
|
||||
|
||||
RUN --mount=type=bind,from={{ blue_build_utils::constants::NUSHELL_IMAGE }}:
|
||||
{%- if let Some(version) = nushell_version -%}
|
||||
{{ version }}
|
||||
{%- else -%}
|
||||
default
|
||||
{%- endif %},src=/nu,dst=/tmp/nu \
|
||||
mkdir -p /usr/libexec/bluebuild/nu \
|
||||
&& cp -r /tmp/nu/* /usr/libexec/bluebuild/nu/ \
|
||||
&& ostree container commit
|
||||
|
||||
RUN --mount=type=bind,from={{ build_scripts_image }},src=/scripts/,dst=/scripts/ \
|
||||
/scripts/pre_build.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,10 @@ RUN \
|
|||
{%- endif %}
|
||||
{%- if let Some(source) = module.get_non_local_source() %}
|
||||
--mount=type=bind,from={{ source }},src=/modules,dst=/tmp/modules,rw \
|
||||
{%- else %}
|
||||
{%- else if module.is_local_source() %}
|
||||
--mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \
|
||||
{%- else %}
|
||||
--mount=type=bind,from=ghcr.io/blue-build/modules/{{ module.module_type }}:latest,src=/modules,dst=/tmp/modules,rw \
|
||||
{%- endif %}
|
||||
{%- if module.module_type == "akmods" %}
|
||||
--mount=type=bind,from=stage-akmods-{{ module.generate_akmods_info(os_version).stage_name }},src=/rpms,dst=/tmp/rpms,rw \
|
||||
|
|
@ -28,8 +30,7 @@ RUN \
|
|||
--mount=type=bind,from={{ build_scripts_image }},src=/scripts/,dst=/tmp/scripts/ \
|
||||
--mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }},sharing=locked \
|
||||
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-{{ recipe.name }}-{{ recipe.image_version }},sharing=locked \
|
||||
/tmp/scripts/run_module.sh '{{ module.module_type }}' '{{ module|json|safe }}' \
|
||||
&& ostree container commit
|
||||
/tmp/scripts/run_module.sh '{{ module.module_type }}' '{{ module|json|safe }}'
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
|
@ -57,8 +58,10 @@ RUN \
|
|||
{%- endif %}
|
||||
{%- if let Some(source) = module.get_non_local_source() %}
|
||||
--mount=type=bind,from={{ source }},src=/modules,dst=/tmp/modules,rw \
|
||||
{%- else %}
|
||||
{%- else if module.is_local_source() %}
|
||||
--mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \
|
||||
{%- else %}
|
||||
--mount=type=bind,from=ghcr.io/blue-build/modules/{{ module.module_type }}:latest,src=/modules,dst=/tmp/modules,rw \
|
||||
{%- endif %}
|
||||
--mount=type=bind,from={{ build_scripts_image }},src=/scripts/,dst=/tmp/scripts/ \
|
||||
/tmp/scripts/run_module.sh '{{ module.module_type }}' '{{ module|json|safe }}'
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
{%- if self::files_dir_exists() %}
|
||||
FROM scratch AS stage-files
|
||||
COPY ./files /files
|
||||
{% else if self::config_dir_exists() %}
|
||||
|
||||
{%~ else if self::config_dir_exists() %}
|
||||
FROM scratch AS stage-config
|
||||
COPY ./config /config
|
||||
{% endif %}
|
||||
|
||||
{%~ if self::modules_exists() %}
|
||||
# Copy modules
|
||||
# The default modules are inside blue-build/modules
|
||||
# Custom modules overwrite defaults
|
||||
FROM scratch AS stage-modules
|
||||
COPY --from=ghcr.io/blue-build/modules:latest /modules /modules
|
||||
{%- if self::modules_exists() %}
|
||||
COPY ./modules /modules
|
||||
{% endif %}
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ COPY ./modules /modules
|
|||
# can be added to the ostree commits.
|
||||
FROM scratch AS stage-bins
|
||||
COPY --from={{ blue_build_utils::constants::COSIGN_IMAGE }} /ko-app/cosign /bins/cosign
|
||||
COPY --from=ghcr.io/blue-build/cli:
|
||||
COPY --from={{ blue_build_utils::constants::BLUE_BULID_IMAGE_REF }}:
|
||||
{%- if let Some(tag) = recipe.blue_build_tag -%}
|
||||
{{ tag }}
|
||||
{%- else -%}
|
||||
|
|
@ -59,6 +59,13 @@ ARG RUST_LOG_STYLE=always
|
|||
{%- endif %}
|
||||
|
||||
{%- if stage.from != "scratch" %}
|
||||
COPY --from={{ blue_build_utils::constants::NUSHELL_IMAGE }}:
|
||||
{%- if let Some(version) = nushell_version -%}
|
||||
{{ version }}
|
||||
{%- else -%}
|
||||
default
|
||||
{%- endif %} /nu/* /usr/libexec/bluebuild/nu/
|
||||
|
||||
# Add compatibility for modules
|
||||
RUN --mount=type=bind,from=stage-bins,src=/bins/,dst=/tmp/bins/ \
|
||||
--mount=type=bind,from={{ build_scripts_image }},src=/scripts/,dst=/tmp/scripts/ \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue