particle-os-cli/integration-tests/Earthfile
Gerald Pinder 46700ab794
chore: Create base integration test setup (#55)
This will allow us to create a suite of tests for our new features
rather than using my personal image repo
2024-02-09 11:47:59 -05:00

57 lines
1.3 KiB
Text

VERSION 0.8
PROJECT blue-build/cli
all:
ARG NIGHTLY=false
BUILD +build-template --NIGHTLY=$NIGHTLY
BUILD +build --NIGHTLY=$NIGHTLY
BUILD +rebase --NIGHTLY=$NIGHTLY
BUILD +upgrade --NIGHTLY=$NIGHTLY
build-template:
ARG NIGHTLY=false
FROM DOCKERFILE \
-f +template-containerfile/test/Containerfile \
+template-containerfile/test/* --NIGHTLY=$NIGHTLY
RUN [ -f /usr/test-file ]
template-containerfile:
ARG NIGHTLY=false
FROM +test-base --NIGHTLY=$NIGHTLY
RUN bluebuild -vv template config/recipe.yml | tee Containerfile
SAVE ARTIFACT /test
build:
ARG NIGHTLY=false
FROM +test-base --NIGHTLY=$NIGHTLY
RUN --privileged bluebuild -vv build config/recipe.yml
rebase:
ARG NIGHTLY=false
FROM +test-base --NIGHTLY=$NIGHTLY
RUN --privileged bluebuild -vv rebase config/recipe.yml
upgrade:
ARG NIGHTLY=false
FROM +test-base --NIGHTLY=$NIGHTLY
RUN mkdir -p /etc/bluebuild && touch /etc/bluebuild/template.tar.gz
RUN --privileged bluebuild -vv upgrade config/recipe.yml
test-base:
ARG NIGHTLY=false
FROM ../+blue-build-cli-alpine --NIGHTLY=$NIGHTLY
COPY ./mock-scripts/ /usr/bin/
WORKDIR /test
COPY ./test-repo /test
# Setup a cosign key pair
RUN echo -n "\n\n" | cosign generate-key-pair
ENV COSIGN_PRIVATE_KEY=$(cat cosign.key)
RUN rm cosign.key