🐛 Fix arch name in arm artifacts (#2011)

* Fix arch name in arm artifacts

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Update test to use new artifact names

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Fix name of security results

Fix test when calling without ISO

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

---------

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
Mauro Morales 2023-11-18 13:18:00 +01:00 committed by GitHub
parent a658a3fa5f
commit cb38c88991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 13 deletions

View File

@ -304,7 +304,8 @@ jobs:
mkdir reports
mv release/*.json reports/
cd reports
sudo tar cvf "kairos-core-${{matrix.flavor}}-amd64-generic-${VERSION}-scan-reports.tar.gz" *.json
filename=$(ls *-grype.json | head -n 1) && filename=${filename%%-grype.json}
sudo tar cvf "${filename}-scan-reports.tar.gz" *.json
mv *.tar.gz ../release/
cd ..
sudo rm -rf release/IMAGE release/VERSION release/versions.yaml

View File

@ -57,9 +57,7 @@ jobs:
# A flag to set the download target as latest release
# The default value is 'false'
latest: true
# TODO: v2.4.2 Enable once we have a release with the new naming
# fileName: 'kairos-${{ inputs.flavor }}-${{ inputs.flavor_release }}*core-amd64-generic*.iso'
fileName: 'kairos-core-${{ inputs.flavor }}*-amd64-generic*.iso'
fileName: 'kairos-${{ inputs.flavor }}-${{ inputs.flavor_release }}*core-amd64-generic*.iso'
out-file-path: ""
- name: Display structure of downloaded files
run: ls -las .
@ -75,9 +73,7 @@ jobs:
- run: |
# release-downloader globing matches more than one iso. Make sure
# we use the right one.
# TODO: v2.4.2 Enable once we have a release with the new naming
# ISO=$(ls kairos-${{ inputs.family }}-${{ inputs.flavor_release }}*core-amd64-generic-v*.iso | grep -v ipxe | head -n 1)
ISO=$(ls kairos-core-${{ inputs.family }}*-amd64-generic-v*.iso | grep -v ipxe | head -n 1)
ISO=$(ls kairos-${{ inputs.family }}-${{ inputs.flavor_release }}*core-amd64-generic-v*.iso | grep -v ipxe | head -n 1)
earthly +run-qemu-test --PREBUILT_ISO=$ISO \
--CONTAINER_IMAGE=ttl.sh/kairos-${{ inputs.flavor }}-${{ inputs.flavor_release }}-${{ github.sha }}:24h \
--TEST_SUITE=upgrade-latest-with-cli

View File

@ -788,6 +788,23 @@ netboot:
SAVE ARTIFACT /build/$ISO_NAME-initrd initrd AS LOCAL build/$ISO_NAME-initrd
SAVE ARTIFACT /build/$ISO_NAME.ipxe ipxe AS LOCAL build/$ISO_NAME.ipxe
artifact-name:
ARG TARGETARCH
ARG --required FAMILY
ARG --required FLAVOR
ARG --required FLAVOR_RELEASE
ARG --required VARIANT
ARG --required MODEL
ARG --required BASE_IMAGE
ARG --required NAMING_FUNC
ARG --required NAMING_EXT
ARG --required KAIROS_VERSION
FROM ubuntu
COPY ./naming.sh /usr/bin/local/naming.sh
RUN echo $(/usr/bin/local/naming.sh ${NAMING_FUNC})${NAMING_EXT} > /ARTIFACT_NAME
SAVE ARTIFACT /ARTIFACT_NAME ARTIFACT_NAME
arm-image:
ARG OSBUILDER_IMAGE
ARG COMPRESS_IMG=true
@ -795,8 +812,8 @@ arm-image:
FROM $OSBUILDER_IMAGE
COPY +version/VERSION ./
RUN echo "version ${VERSION}"
ARG KAIROS_VERSION=$(cat VERSION)
RUN echo "version ${KAIROS_VERSION}"
ARG TARGETARCH
ARG --required FAMILY
@ -806,9 +823,9 @@ arm-image:
ARG --required MODEL
ARG --required BASE_IMAGE
COPY ./naming.sh .
ARG IMAGE_NAME=$(./naming.sh bootable_artifact_name).img
RUN echo $IMAGE_NAME
COPY --platform=linux/arm64 (+artifact-name/ARTIFACT_NAME --KAIROS_VERSION=${KAIROS_VERSION} --NAMING_FUNC=bootable_artifact_name --NAMING_EXT=".img") /ARTIFACT_NAME
ARG IMAGE_NAME=$(cat /ARTIFACT_NAME)
RUN rm /ARTIFACT_NAME
WORKDIR /build
# These sizes are in MB
ENV SIZE="15200"
@ -861,8 +878,8 @@ prepare-arm-image:
ARG --required BASE_IMAGE
ARG --required MODEL
COPY ./naming.sh .
ARG IMAGE_NAME=$(./naming.sh bootable_artifact_name).img
COPY --platform=linux/arm64 (+artifact-name/ARTIFACT_NAME --KAIROS_VERSION=${KAIROS_VERSION} --NAMING_FUNC=bootable_artifact_name --NAMING_EXT=".img") /ARTIFACT_NAME
ARG IMAGE_NAME=$(cat /ARTIFACT_NAME)
WORKDIR /build
# These sizes are in MB
@ -1131,6 +1148,12 @@ run-qemu-test:
IF [ -n "$PREBUILT_ISO" ]
ENV ISO=/test/$PREBUILT_ISO
ELSE
ARG --required FLAVOR
ARG --required FLAVOR_RELEASE
ARG --required FAMILY
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT
COPY +iso/kairos.iso kairos.iso
ENV ISO=/test/kairos.iso
END