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