From c5ffa93ed55f1c446a739dd0992ee5a513bb88b6 Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Tue, 1 Oct 2024 09:56:29 -0400 Subject: [PATCH 1/2] Fix base-image CI exiting early when update is needed --- .github/actions/base_images/action.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/base_images/action.yml b/.github/actions/base_images/action.yml index 96b65ce5..d537ae49 100644 --- a/.github/actions/base_images/action.yml +++ b/.github/actions/base_images/action.yml @@ -45,20 +45,20 @@ runs: # Enable running/building ARM64 images: https://github.com/multiarch/qemu-user-static sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes IMAGES=() - for IMAGE in base pulp-ci-centos9; do - for ARCH in arm64 amd64; do - echo "Checking if rebuild needed for ${IMAGE}:${ARCH}" - podman run --pull=never pulp/${IMAGE}:ci-${ARCH} bash -c "dnf check-upgrade" - if [ $? -gt 0 ]; then - echo "Rebuild needed for ${IMAGE}:${ARCH}" - IMAGES+=('${IMAGE}:${ARCH}') - fi - done + for ARCH in arm64 amd64; do + echo "Checking if rebuild needed for base:${ARCH} & pulp-ci-centos9:${ARCH}" + if ! podman run --pull=never pulp/base:ci-${ARCH} bash -c "dnf check-upgrade"; then + echo "Rebuild needed for base:${ARCH} & pulp-ci-centos9:${ARCH}" + IMAGES+=("base:${ARCH}" "pulp-ci-centos9:${ARCH}") + elif ! podman run --pull=never pulp/pulp-ci-centos9:ci-${ARCH} bash -c "dnf check-upgrade"; then + echo "Rebuild needed for just pulp-ci-centos9:${ARCH}" + IMAGES+=("pulp-ci-centos9:${ARCH}") + fi done if [ ${#IMAGES[@]} -eq 0 ]; then echo "No rebuilds needed :)" else - echo "BUILD_IMAGES=[$(echo ${IMAGES[@]} | sed 's/ /, /g')]" >> $GITHUB_ENV + echo "BUILD_IMAGES=[$(echo ${IMAGES[@]@Q} | sed 's/ /, /g')]" >> $GITHUB_ENV fi shell: bash From f39184d0ae6a349830f3a50de705a2aee58640ed Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Wed, 2 Oct 2024 10:38:29 -0400 Subject: [PATCH 2/2] Have the compose test use the branch name for the web tag --- .github/actions/test_image/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/test_image/action.yml b/.github/actions/test_image/action.yml index 365dce96..90086087 100644 --- a/.github/actions/test_image/action.yml +++ b/.github/actions/test_image/action.yml @@ -53,7 +53,8 @@ runs: if [ "${{ inputs.image_variant }}" == "nightly" ]; then WEB_TAG="nightly" else - WEB_TAG="${{ inputs.app_branch }}" + # This will be the branch we are running on, either latest or version branch + WEB_TAG="${{ github.base_ref || github.ref_name }}" fi else FILE="compose.yml"