Skip to content

Commit

Permalink
🔧 Allow testing overlya files branches (#2791)
Browse files Browse the repository at this point in the history
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 <itxaka@kairos.io>
  • Loading branch information
Itxaka authored Aug 6, 2024
1 parent 7989d2e commit 53b966f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 53b966f

Please # to comment.