VERSION 0.8 PROJECT blue-build/cli all: BUILD +test-image BUILD +test-secureblue BUILD +test-legacy-image BUILD +build BUILD +rebase BUILD +upgrade test-image: FROM +build-template --src=template-containerfile WORKDIR /tmp/test COPY ./test-scripts/*.sh ./ DO +RUN_TESTS test-legacy-image: FROM +build-template --src=template-legacy-containerfile WORKDIR /tmp/test COPY ./test-scripts/*.sh ./ DO +RUN_TESTS test-secureblue: FROM +build-template --src=template-secureblue WORKDIR /tmp/test COPY ./test-scripts/secureblue/*.sh ./ DO +RUN_TESTS build-template: ARG --required src FROM DOCKERFILE \ -f +$src/test/Containerfile \ +$src/test/* template-containerfile: FROM +test-base RUN bluebuild -vv template recipes/recipe.yml | tee Containerfile SAVE ARTIFACT /test template-legacy-containerfile: FROM +legacy-base RUN bluebuild -vv template config/recipe.yml | tee Containerfile SAVE ARTIFACT /test template-secureblue: FROM +secureblue-base RUN bluebuild -vv template -o Containerfile config/recipes/general/recipe-silverblue-nvidia.yml SAVE ARTIFACT /test build: FROM +test-base RUN bluebuild -vv build recipes/recipe.yml rebase: FROM +test-base RUN bluebuild -vv rebase recipes/recipe.yml upgrade: FROM +test-base RUN mkdir -p /etc/bluebuild && touch /etc/bluebuild/cli_test.tar.gz RUN bluebuild -vv upgrade recipes/recipe.yml secureblue-base: FROM +test-base RUN rm -fr /test GIT CLONE https://github.com/secureblue/secureblue.git /test DO +GEN_KEYPAIR legacy-base: FROM +test-base RUN rm -fr /test COPY ./legacy-test-repo /test DO +GEN_KEYPAIR test-base: FROM ../+blue-build-cli-alpine ENV CLICOLOR_FORCE=1 COPY ./mock-scripts/ /usr/bin/ WORKDIR /test COPY ./test-repo /test DO +GEN_KEYPAIR GEN_KEYPAIR: FUNCTION # 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 RUN_TESTS: FUNCTION FOR script IN $(ls *.sh) RUN --no-cache chmod +x $script \ && echo "Running test $script" \ && ./$script END