From aaa1c1cb61fc4a9e5291aa3e3a23f5e9d0bf6101 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 29 Sep 2023 14:37:36 +0200 Subject: [PATCH] .github/ci: Run image reports job after vms job It shows changes also in OEM images and these are built in vms step. --- .github/workflows/ci.yaml | 103 +++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 155879414ad..dd177de1da9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -195,6 +195,57 @@ jobs: --output_root="${CI_CONTAINER_ARTIFACT_ROOT}" \ --torcx_root="${CI_CONTAINER_TORCX_ROOT}" prodtar container + - name: Build VM image(s) + shell: bash + run: | + set -euo pipefail + set -x + + source ci-automation/ci_automation_common.sh + + images_out="images" + + has_packet=0 + has_pxe=0 + formats="${IMAGE_FORMATS}" + for format in "${formats}";do + [[ "${format}" = 'packet' ]] || [[ "${format}" = 'equinix_metal' ]] && has_packet=1 + [[ "${format}" = 'pxe' ]] && has_pxe=1 + done + + [[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}" + if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then + formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d') + formats+=" vmware vmware_insecure vmware_ova vmware_raw" + fi + if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then + formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d') + formats+=" ami ami_vmdk" + fi + # Keep compatibility with SDK scripts where "equinix_metal" remains unknown. + formats=$(echo "$formats" | tr ' ' '\n' | sed 's/equinix_metal/packet/g') + + for format in ${formats}; do + echo " ################### VENDOR '${format}' ################### " + ./run_sdk_container -n "${container_name}" \ + ./image_to_vm.sh --format "${format}" --board="${arch}-usr" \ + --from "${CI_CONTAINER_ARTIFACT_ROOT}/${arch}-usr/latest" \ + --image_compression_formats=bz2 + done + + # upload-artifacts cannot handle artifact uploads from sym-linked directories (no, really) + # so we move things around. + mkdir -p artifacts/images + ( + cd artifacts/${arch}-usr/latest/ + mv * ../../images/ + ) + + # create a tarball for torcx package + JSON file because upload-artifacts cannot handle filenames containing colons + # (such as "docker:20.10.torcx.tgz") + mv artifacts/torcx/${arch}-usr/latest/torcx_manifest.json artifacts/torcx/pkgs/ + tar -C artifacts/torcx/pkgs/ -cvf torcx.tar . + - name: Generate reports against last release shell: bash run: | @@ -309,58 +360,6 @@ jobs: "${show_changes_env[@]}" --- "${show_changes_params[@]}" -- \ "${oemids[@]}" - - name: Build VM image(s) - shell: bash - run: | - set -euo pipefail - set -x - - source ci-automation/ci_automation_common.sh - - images_out="images" - - has_packet=0 - has_pxe=0 - formats="${IMAGE_FORMATS}" - for format in "${formats}";do - [[ "${format}" = 'packet' ]] || [[ "${format}" = 'equinix_metal' ]] && has_packet=1 - [[ "${format}" = 'pxe' ]] && has_pxe=1 - done - - [[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}" - if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then - formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d') - formats+=" vmware vmware_insecure vmware_ova vmware_raw" - fi - if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then - formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d') - formats+=" ami ami_vmdk" - fi - # Keep compatibility with SDK scripts where "equinix_metal" remains unknown. - formats=$(echo "$formats" | tr ' ' '\n' | sed 's/equinix_metal/packet/g') - - for format in ${formats}; do - echo " ################### VENDOR '${format}' ################### " - ./run_sdk_container -n "${container_name}" \ - ./image_to_vm.sh --format "${format}" --board="${arch}-usr" \ - --from "${CI_CONTAINER_ARTIFACT_ROOT}/${arch}-usr/latest" \ - --image_compression_formats=bz2 - done - - # upload-artifacts cannot handle artifact uploads from sym-linked directories (no, really) - # so we move things around. - mkdir -p artifacts/images - ( - cd artifacts/${arch}-usr/latest/ - mv * ../../images/ - ) - - # create a tarball for torcx package + JSON file because upload-artifacts cannot handle filenames containing colons - # (such as "docker:20.10.torcx.tgz") - mv artifacts/torcx/${arch}-usr/latest/torcx_manifest.json artifacts/torcx/pkgs/ - tar -C artifacts/torcx/pkgs/ -cvf torcx.tar . - - - name: Upload binpkgs uses: actions/upload-artifact@v3 with: