Skip to content
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
6 changes: 2 additions & 4 deletions .github/actions/build-deb/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ runs:

# Run the RPM build process.
cd ${GITHUB_WORKSPACE}/
make srpm \
USHIFT_GITREF=${{ inputs.ushift-gitref }} \
OKD_VERSION_TAG=${{ inputs.okd-version-tag }}

make rpm \
USHIFT_GITREF=${{ inputs.ushift-gitref }} \
OKD_VERSION_TAG=${{ inputs.okd-version-tag }} \
RPM_OUTDIR=/mnt/rpms

Comment thread
ggiguash marked this conversation as resolved.
- name: Convert the MicroShift RPMs to Debian packages
Expand Down
6 changes: 2 additions & 4 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ runs:

# Run the RPM build process.
cd ${GITHUB_WORKSPACE}/
make srpm \
USHIFT_GITREF="${{ inputs.ushift-gitref }}" \
OKD_VERSION_TAG="${{ inputs.okd-version-tag }}"

make rpm \
USHIFT_GITREF="${{ inputs.ushift-gitref }}" \
OKD_VERSION_TAG="${{ inputs.okd-version-tag }}" \
RPM_OUTDIR=/mnt/rpms

Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Build MicroShift bootc container image
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ make check # Run linters (hadolint + shellcheck)

- `packaging/`: Containerfiles for SRPM, RPM, and bootc builds
- `src/`: Build scripts and component customizations
- `src/image/`: Image build scripts (prebuild.sh replaces OKD images, postbuild.sh configures)
- `src/image/`: Image build scripts (prebuild.sh replaces OKD images)
- `src/okd/`: OKD version detection and ARM builds
- `src/kindnet/`: Kindnet CNI assets and spec
- `src/topolvm/`: TopoLVM CSI assets and spec
Expand Down
27 changes: 11 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,40 +71,35 @@ all:
@echo ""

.PHONY: rpm
rpm:
@if ! sudo podman image exists "${SRPM_IMAGE}" ; then \
echo "ERROR: Run 'make srpm' to build the MicroShift SRPMs" ; \
exit 1 ; \
fi

rpm: srpm
@echo "Building the MicroShift RPMs image"
sudo podman build \
-t "${RPM_IMAGE}" \
--ulimit nofile=524288:524288 \
-f packaging/rpm.Containerfile .

@echo "Extracting the MicroShift RPMs"
outdir="$${RPM_OUTDIR:-$$(mktemp -d /tmp/microshift-rpms-XXXXXX)}" && \
@outdir="$${RPM_OUTDIR:-$$(mktemp -d /tmp/microshift-rpms-XXXXXX)}" && \
mntdir="$$(sudo podman image mount "${RPM_IMAGE}")" && \
trap "sudo podman image umount '${RPM_IMAGE}' >/dev/null" EXIT && \
sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/RPMS/." "$${outdir}" && \
sudo podman image umount "${RPM_IMAGE}" && \
echo "" && \
echo "Build completed successfully" && \
echo "RPMs are available in '$${outdir}'"
echo -e "\nBuild completed successfully\nRPMs are available in '$${outdir}'"
Comment thread
ggiguash marked this conversation as resolved.

.PHONY: srpm
srpm:
@echo "Building the MicroShift SRPM image"
outdir="$${SRPM_WORKDIR:-$$(mktemp -d /tmp/microshift-srpms-XXXXXX)}" && \
sudo podman build \
-t "${SRPM_IMAGE}" \
--build-arg USHIFT_GITREF="${USHIFT_GITREF}" \
--build-arg OKD_VERSION_TAG="${OKD_VERSION_TAG}" \
--build-arg OKD_RELEASE_IMAGE_X86_64="${OKD_RELEASE_IMAGE_X86_64}" \
--build-arg OKD_RELEASE_IMAGE_AARCH64="${OKD_RELEASE_IMAGE_AARCH64}" \
--volume "$${outdir}:/output:Z" \
-f packaging/srpm.Containerfile . && \
echo "SRPMs are available in '$${outdir}'"
-f packaging/srpm.Containerfile .

@outdir="$${SRPM_WORKDIR:-$$(mktemp -d /tmp/microshift-srpms-XXXXXX)}" && \
mntdir="$$(sudo podman image mount "${SRPM_IMAGE}")" && \
trap "sudo podman image umount '${SRPM_IMAGE}' >/dev/null" EXIT && \
sudo cp -r "$${mntdir}/home/microshift/microshift/_output/rpmbuild/SRPMS/." "$${outdir}" && \
echo -e "\nBuild completed successfully\nSRPM is available in '$${outdir}'"
Comment thread
ggiguash marked this conversation as resolved.

.PHONY: rpm-to-deb
rpm-to-deb:
Expand Down
15 changes: 11 additions & 4 deletions packaging/rpm.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ WORKDIR /tmp

# hadolint ignore=DL4006
RUN \
echo "# Extract the MicroShift source code into /home/microshift/microshift - bootc builder is reusing file" && \
echo "# Extract the MicroShift source code into /home/microshift/microshift" && \
echo "# Note: Bootc builder is reusing the source archive" && \
rpm2cpio ./microshift-*.src.rpm | cpio -idmv && \
mkdir -p /home/microshift/microshift && \
tar xf ./microshift-*.tar.gz -C /home/microshift/microshift --strip-components=1 && \
\
echo "# Build the RPMs from the SRPM" && \
rpmbuild --quiet --define 'microshift_variant community' --rebuild ./microshift-*.src.rpm && \
\
echo "# Finally, move the RPMs" && \
mkdir -p ${BUILDER_RPM_REPO_PATH} && \
echo "# Move the RPMs" && \
mkdir -p ${BUILDER_RPM_REPO_PATH}/ && \
rm -rf ${BUILDER_RPM_REPO_PATH}/RPMS && \
mv /root/rpmbuild/RPMS ${BUILDER_RPM_REPO_PATH}/ && \
mkdir -p ${BUILDER_RPM_REPO_PATH}/RPMS/srpms/ && \
mv ./microshift-*.src.rpm ${BUILDER_RPM_REPO_PATH}/RPMS/srpms/ && \
mv ./version.txt ${BUILDER_RPM_REPO_PATH}/RPMS/ && \
\
echo "# Create the repository and cleanup" && \
createrepo -v ${BUILDER_RPM_REPO_PATH}/RPMS && \
rm -rf /root/rpmbuild /tmp/*
rm -rf /root/rpmbuild /tmp/* /root/.cache/go-build
8 changes: 3 additions & 5 deletions packaging/srpm.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ RUN [ "$(uname -m)" = "aarch64" ] && ARCH="-arm64" || ARCH="" ; \
OKD_CLIENT_URL="https://github.com/okd-project/okd/releases/download/${OKD_VERSION_TAG}/openshift-client-linux${ARCH}-${OKD_VERSION_TAG}.tar.gz" && \
echo "OKD_CLIENT_URL: ${OKD_CLIENT_URL}" && \
curl -L --retry 5 -o /tmp/okd-client.tar.gz "${OKD_CLIENT_URL}" && \
tar -xzf /tmp/okd-client.tar.gz -C /tmp && \
mv /tmp/oc /usr/local/bin/oc && \
rm -rf /tmp/okd-client.tar.gz ;
tar -xzf /tmp/okd-client.tar.gz -C /usr/local/bin/ && \
rm -rf /tmp/okd-client.tar.gz

WORKDIR ${HOME}

Expand Down Expand Up @@ -68,5 +67,4 @@ RUN sed -i -e 's,CHECK_RPMS="y",,g' -e 's,CHECK_SRPMS="y",,g' ./packaging/rpm/ma
"${USHIFT_MODIFY_SPEC_SCRIPT}" ./packaging/rpm/microshift.spec "${SPEC_KINDNET}" "${SPEC_TOPOLVM}"

COPY --chmod=755 ./src/image/build-rpms.sh ${USHIFT_BUILDRPMS_SCRIPT}
RUN "${USHIFT_BUILDRPMS_SCRIPT}" srpm && \
cp ./_output/rpmbuild/SRPMS/* /output/
RUN "${USHIFT_BUILDRPMS_SCRIPT}" srpm
11 changes: 0 additions & 11 deletions src/image/postbuild.sh

This file was deleted.

Loading