From 53b966f2fac2a0cab8e9156ad76eb87e423cf34a Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 6 Aug 2024 09:54:38 +0200 Subject: [PATCH] :wrench: Allow testing overlya files branches (#2791) Instead of waiting for them to trickled down, we can easily test them and integrate them intot he rootfs. This provides a OVERLAY_FILES_DEV_BRANCH argument that can be set to a branch or commit of the packages repo in order to test ongoing branches or single commits directly. Currently does not remove the existing files so anything that removes files cannot be tested by this as we cant now in advance which files to delete, so it only works by overwriting the files or adding new ones. Signed-off-by: Itxaka --- Earthfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Earthfile b/Earthfile index 0ad6ea3a3..d263af212 100644 --- a/Earthfile +++ b/Earthfile @@ -281,6 +281,7 @@ base-image: COPY +git-version/GIT_VERSION VERSION ARG KAIROS_AGENT_DEV_BRANCH ARG IMMUCORE_DEV_BRANCH + ARG OVERLAY_FILES_DEV_BRANCH IF [ "$KAIROS_AGENT_DEV_BRANCH" != "" ] RUN rm -rf /usr/bin/kairos-agent @@ -298,12 +299,25 @@ base-image: fi END + IF [ "$OVERLAY_FILES_DEV_BRANCH" != "" ] + COPY +overlay-files/files / + END + ARG _CIMG=$(cat /IMAGE) SAVE IMAGE $_CIMG SAVE ARTIFACT /IMAGE AS LOCAL build/IMAGE SAVE ARTIFACT VERSION AS LOCAL build/VERSION SAVE ARTIFACT /etc/kairos/versions.yaml versions.yaml AS LOCAL build/versions.yaml +# Dev target to extract overlay files from specific commit or branch for testing +overlay-files: + ARG OVERLAY_FILES_DEV_BRANCH + WORKDIR /build + RUN apk --no-cache add git + RUN --no-cache git clone --branch $OVERLAY_FILES_DEV_BRANCH https://github.com/kairos-io/packages.git /build/ + SAVE ARTIFACT /build/packages/static/kairos-overlay-files/files/ files + + image-rootfs: BUILD +base-image # Make sure the image is also saved locally FROM +base-image