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

feat(ublue-builder): add github groups and make it much more verbose for debugging RPM failures #172

Merged
merged 1 commit into from
Feb 15, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
with:
containerfiles: |
./${{ env.IMAGE_NAME }}/Containerfile
context: ${{ env.IMAGE_NAME }}
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.DEFAULT_TAG }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
4 changes: 2 additions & 2 deletions ublue-builder/Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM registry.fedoraproject.org/fedora:latest

COPY ublue-builder/mock-wrapper /usr/bin
COPY mock-wrapper /usr/bin

RUN dnf install -y mock rpmdevtools rpkg copr-cli && dnf clean all
RUN dnf install -y mock rpmdevtools rpkg copr-cli rpmlint && dnf clean all

ENTRYPOINT ["/usr/bin/mock-wrapper"]
30 changes: 26 additions & 4 deletions ublue-builder/mock-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,47 @@ BUILDER_NO_INCLUDE_SRPM=${BUILDER_NO_INCLUDE_SRPM:-0}
SPEC_FILE=$1
shift

set -xeuo pipefail
set -euo pipefail

if [ "$SPEC_FILE" == "" ] ; then
echo "No spec file selected"
exit 1
fi

group_start() {
WHAT=$1
shift
printf "::group:: ===$WHAT===\n"
set -x
}
group_end() {
set +x
printf "::endgroup::\n"
}

group_start "Generate spec file with rpkg"
OUTDIR=$(mktemp -d)

SPEC_PATH=$(realpath $(dirname $SPEC_FILE))

rpkg --path ${SPEC_PATH} spec --outdir $OUTDIR
cat $OUTDIR/*.spec
group_end

spectool -ag ${OUTDIR}/*.spec -C ${OUTDIR}
group_start "Lint spec file (non-blocking)"
set +euo pipefail
rpmlint "${OUTDIR}/*.spec"
set -euo pipefail
group_end

group_start "Fetch sources and generate srpm"
spectool -ag ${OUTDIR}/*.spec -C ${OUTDIR}
rpkg --path ${SPEC_PATH} srpm --outdir $OUTDIR
ls -lah ${OUTDIR}
group_end

group_start "Build RPM with mock"
if [ "$BUILDER_NO_INCLUDE_SRPM" != "1" ] ; then
mock --isolation=simple $OUTDIR/*.src.rpm $@
else
mock --isolation=simple $@
fi
group_end