From a30ca9dc6ccf4108d31197954bace39484ef78aa Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 4 Oct 2022 21:44:27 +0200 Subject: [PATCH] Move some CI tests to CircleCI (#178) * :robot: Run datasource tests on CircleCI * :robot: Run bundles tests on CircleCI * :robot: Fixups * :robot: Run cli tests to CircleCI * :robot: Extend wait time * :robot: Fail when VM is aborted * :robot: Enlart waiting time window * :robot: Do not set VM specs * :robot: Shift just some of the tests --- Earthfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Earthfile b/Earthfile index bad5d0e..4d251ce 100644 --- a/Earthfile +++ b/Earthfile @@ -453,6 +453,52 @@ run-qemu-test: RUN PATH=$PATH:$GOPATH/bin ginkgo --label-filter "$TEST_SUITE" --fail-fast -r ./tests/ +### +### Artifacts targets +### + +## Gets the latest release artifacts for a given release +pull-release: + FROM alpine + RUN apk add curl wget + RUN curl -s https://api.github.com/repos/kairos-io/kairos/releases/latest | grep "browser_download_url.*${FLAVOR}.*iso" | cut -d : -f 2,3 | tr -d \" | wget -i - + RUN mkdir build + RUN mv *.iso build/ + SAVE ARTIFACT build AS LOCAL build + +## Pull build artifacts from BUNDLE_IMAGE (expected arg) +pull-build-artifacts: + ARG OSBUILDER_IMAGE + FROM $OSBUILDER_IMAGE + RUN zypper in -y jq docker + COPY +uuidgen/UUIDGEN ./ + COPY +version/VERSION ./ + ARG UUIDGEN=$(cat UUIDGEN) + ARG BUNDLE_IMAGE=ttl.sh/$UUIDGEN:8h + + COPY +luet/luet /usr/bin/luet + RUN luet util unpack $BUNDLE_IMAGE build + SAVE ARTIFACT build AS LOCAL build + +## Push build artifacts as BUNDLE_IMAGE (expected arg, common is to use ttl.sh/$(uuidgen):8h) +push-build-artifacts: + ARG OSBUILDER_IMAGE + FROM $OSBUILDER_IMAGE + RUN zypper in -y jq docker + COPY +uuidgen/UUIDGEN ./ + COPY +version/VERSION ./ + ARG UUIDGEN=$(cat UUIDGEN) + ARG BUNDLE_IMAGE=ttl.sh/$UUIDGEN:8h + + COPY . . + COPY +luet/luet /usr/bin/luet + + RUN cd build && tar cvf ../build.tar ./ + RUN luet util pack $BUNDLE_IMAGE build.tar image.tar + WITH DOCKER + RUN docker load -i image.tar && docker push $BUNDLE_IMAGE + END + # bundles tests needs to run in sequence: # +prepare-bundles-tests # +run-bundles-tests