-
Notifications
You must be signed in to change notification settings - Fork 12
Building RPMs using COPR #161
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,10 @@ inputs: | |||||
| build: | ||||||
| description: Types of artifacts to build (all, rpms, bootc-image) | ||||||
| required: true | ||||||
| rpm-image: | ||||||
| description: Image with the RPMs | ||||||
| required: false | ||||||
| default: microshift-okd-rpm | ||||||
|
|
||||||
| runs: | ||||||
| using: "composite" | ||||||
|
|
@@ -41,9 +45,11 @@ runs: | |||||
|
|
||||||
| - name: Prepare the build and run environment | ||||||
| uses: ./.github/actions/prebuild | ||||||
| if: inputs.rpm-builder == 'microshift-okd-rpm' | ||||||
|
|
||||||
| - name: Build MicroShift RPMs | ||||||
| shell: bash | ||||||
| if: inputs.rpm-builder == 'microshift-okd-rpm' | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same typo: Proposed fix- if: inputs.rpm-builder == 'microshift-okd-rpm'
+ if: inputs.rpm-image == 'microshift-okd-rpm'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| run: | | ||||||
| # See https://github.com/microshift-io/microshift/blob/main/docs/build.md | ||||||
| # for more information about the build process. | ||||||
|
|
@@ -73,6 +79,7 @@ runs: | |||||
| make image \ | ||||||
| BOOTC_IMAGE_URL="${{ inputs.bootc-image-url }}" \ | ||||||
| BOOTC_IMAGE_TAG="${{ inputs.bootc-image-tag }}" \ | ||||||
| RPM_IMAGE="${{ inputs.rpm-image }}" \ | ||||||
| ${make_opts[@]} | ||||||
|
|
||||||
| - name: Run a test to verify that MicroShift is functioning properly | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||||||||||||||||||||||||||||
| FROM quay.io/fedora/fedora:42 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| RUN dnf install -y \ | ||||||||||||||||||||||||||||||||||
| --setopt=install_weak_deps=False \ | ||||||||||||||||||||||||||||||||||
| copr-cli createrepo rpm2cpio cpio && \ | ||||||||||||||||||||||||||||||||||
| dnf clean all | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| ARG COPR_BUILD_ID= | ||||||||||||||||||||||||||||||||||
| ARG BUILDER_RPM_REPO_PATH=/home/microshift/microshift/_output/rpmbuild/RPMS | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate COPR_BUILD_ID is provided.
Add validation after the ARG declarations: ARG COPR_BUILD_ID=
ARG BUILDER_RPM_REPO_PATH=/home/microshift/microshift/_output/rpmbuild/RPMS
+RUN if [ -z "${COPR_BUILD_ID}" ]; then \
+ echo "ERROR: COPR_BUILD_ID build argument is required" >&2; \
+ exit 1; \
+ fi
+
# hadolint ignore=DL3003,DL4006,SC3040
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # hadolint ignore=DL4006 | ||||||||||||||||||||||||||||||||||
| RUN \ | ||||||||||||||||||||||||||||||||||
| echo "# Download the RPMs from COPR" && \ | ||||||||||||||||||||||||||||||||||
| copr download-build --rpms --chroot "epel-9-$(uname -m)" --dest /tmp/rpms ${COPR_BUILD_ID} && \ | ||||||||||||||||||||||||||||||||||
| \ | ||||||||||||||||||||||||||||||||||
| echo "# Extract the MicroShift source code into /home/microshift/microshift" && \ | ||||||||||||||||||||||||||||||||||
| mkdir -p /home/microshift/microshift && \ | ||||||||||||||||||||||||||||||||||
| cd /tmp/rpms/"epel-9-$(uname -m)"/ && \ | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix hadolint DL3003 violation causing pipeline failure. The Proposed fix (add to ignore list)-# hadolint ignore=DL4006
+# hadolint ignore=DL3003,DL4006
RUN \📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Actions: linters[error] 12-12: Hadolint failed on containerfile with DL3003: Use WORKDIR to switch to a directory. (This is reported as a warning by Hadolint, but the step exited with an error in the CI pipeline.) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| rpm2cpio microshift-*.src.rpm | cpio -idmv && \ | ||||||||||||||||||||||||||||||||||
| tar xf microshift-*.tar.gz -C /home/microshift/microshift --strip-components=1 && \ | ||||||||||||||||||||||||||||||||||
| \ | ||||||||||||||||||||||||||||||||||
| echo "# Move the RPMs" && \ | ||||||||||||||||||||||||||||||||||
| mkdir -p ${BUILDER_RPM_REPO_PATH} && \ | ||||||||||||||||||||||||||||||||||
| mv /tmp/rpms/"epel-9-$(uname -m)"/*.rpm ${BUILDER_RPM_REPO_PATH}/ && \ | ||||||||||||||||||||||||||||||||||
| \ | ||||||||||||||||||||||||||||||||||
| echo "# Create the repository and cleanup" && \ | ||||||||||||||||||||||||||||||||||
| createrepo -v ${BUILDER_RPM_REPO_PATH} && \ | ||||||||||||||||||||||||||||||||||
| rm -rf /tmp/rpms | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| FROM quay.io/fedora/fedora:42 | ||
|
|
||
| RUN dnf install -y copr-cli && dnf clean all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incorrect input reference:
rpm-buildershould berpm-image.The condition references
inputs.rpm-builderbut the input is namedrpm-image(line 34). This will cause the condition to always evaluate as false.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents