Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix base-image CI exiting early when update is needed #671

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/actions/base_images/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion .github/actions/test_image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading