fix: Pull extra akmods image too (#169)

Adds the new `-extra` image from akmods image
This commit is contained in:
Gerald Pinder 2024-04-27 15:01:06 -04:00 committed by GitHub
parent 92150693d4
commit 3898202bc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 15 deletions

View file

@ -37,7 +37,9 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.ref }}
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
@ -86,7 +88,9 @@ jobs:
# Setup repo and add caching
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.ref }}
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Run integration tests
run: earthly --ci -P ./integration-tests+all
@ -125,7 +129,9 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.ref }}
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install bluebuild
run: |

View file

@ -2,16 +2,16 @@
modules:
# Tests installing rpms from a combo image stage
- type: akmods
install:
- nct6687d
- openrazer
- openrgb
# Tests pulling surface image
- type: akmods
base: surface
nvidia: true
# install:
# - nvidia
# - openrazer
# - openrgb
# Tests pulling main image
- type: akmods
# Tests pulling image for main nvidia
- type: akmods
@ -20,3 +20,4 @@ modules:
# Test pulling image for base asus
- type: akmods
base: asus
nvidia: true

View file

@ -1,6 +1,6 @@
name: cli/test
description: This is my personal OS image.
base-image: ghcr.io/ublue-os/silverblue-surface
base-image: ghcr.io/ublue-os/silverblue-main
image-version: 39
modules:
- from-file: akmods.yml

View file

@ -2,6 +2,6 @@ use typed_builder::TypedBuilder;
#[derive(Debug, Clone, TypedBuilder, PartialEq, Eq, Hash)]
pub struct AkmodsInfo {
pub images: (String, Option<String>),
pub images: (String, String, Option<String>),
pub stage_name: String,
}

View file

@ -120,22 +120,34 @@ impl<'a> Module<'a> {
.images(match (base, nvidia) {
(Some(b), NvidiaAkmods::Nvidia(nv)) if !b.is_empty() && nv => (
format!("akmods:{b}-{os_version}"),
format!("akmods-extra:{b}-{os_version}"),
Some(format!("akmods-nvidia:{b}-{os_version}")),
),
(Some(b), NvidiaAkmods::Version(nv)) if !b.is_empty() && nv > 0 => (
format!("akmods:{b}-{os_version}"),
format!("akmods-extra:{b}-{os_version}"),
Some(format!("akmods-nvidia:{b}-{os_version}-{nv}")),
),
(Some(b), _) if !b.is_empty() => (format!("akmods:{b}-{os_version}"), None),
(Some(b), _) if !b.is_empty() => (
format!("akmods:{b}-{os_version}"),
format!("akmods-extra:{b}-{os_version}"),
None,
),
(_, NvidiaAkmods::Nvidia(nv)) if nv => (
format!("akmods:main-{os_version}"),
format!("akmods-extra:main-{os_version}"),
Some(format!("akmods-nvidia:main-{os_version}")),
),
(_, NvidiaAkmods::Version(nv)) if nv > 0 => (
format!("akmods:main-{os_version}"),
format!("akmods-extra:main-{os_version}"),
Some(format!("akmods-nvidia:main-{os_version}-{nv}")),
),
_ => (format!("akmods:main-{os_version}"), None),
_ => (
format!("akmods:main-{os_version}"),
format!("akmods-extra:main-{os_version}"),
None,
),
})
.stage_name(format!(
"{}{}",

View file

@ -1,7 +1,8 @@
{%- for info in recipe.modules_ext.get_akmods_info_list(os_version) %}
FROM scratch as stage-akmods-{{ info.stage_name }}
COPY --from=ghcr.io/ublue-os/{{ info.images.0 }} /rpms /rpms
{%- if let Some(nv_image) = info.images.1 %}
COPY --from=ghcr.io/ublue-os/{{ info.images.1 }} /rpms /rpms
{%- if let Some(nv_image) = info.images.2 %}
COPY --from=ghcr.io/ublue-os/{{ nv_image }} /rpms /rpms
{%- endif %}
{%- endfor %}