mirror of
https://github.com/upa/mscp.git
synced 2026-02-17 03:14:44 +08:00
build source rpm inside a container
A new build target `build-srpm` builds mscp src.rpm inside a docker container. The src.rpm can be published at COPR.
This commit is contained in:
3
docker/.gitignore
vendored
Normal file
3
docker/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
# generated by cmake
|
||||
rpmbuild.Dockerfile
|
||||
22
docker/build-srpm.Dockerfile
Normal file
22
docker/build-srpm.Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM rockylinux:9
|
||||
|
||||
# install pytest, sshd for test, and rpm-build
|
||||
RUN set -ex && yum -y install rpm-build rpmdevtools
|
||||
|
||||
ARG mscpdir="/mscp-0.1.3"
|
||||
ARG mscptgz="mscp-0.1.3.tar.gz"
|
||||
|
||||
COPY . ${mscpdir}
|
||||
|
||||
# install build dependency
|
||||
RUN ${mscpdir}/scripts/install-build-deps.sh
|
||||
|
||||
# prepare rpmbuild
|
||||
RUN rpmdev-setuptree \
|
||||
&& rm -rf ${mscpdir}/build \
|
||||
&& tar zcvf /${mscptgz} --exclude-vcs ${mscpdir} \
|
||||
&& cp /${mscptgz} ~/rpmbuild/SOURCES/ \
|
||||
&& cp ${mscpdir}/rpm/mscp.spec ~/rpmbuild/SPECS/
|
||||
|
||||
# build rpm and src.rpm
|
||||
RUN rpmbuild -ba ~/rpmbuild/SPECS/mscp.spec
|
||||
22
docker/build-srpm.Dockerfile.in
Normal file
22
docker/build-srpm.Dockerfile.in
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM rockylinux:9
|
||||
|
||||
# install pytest, sshd for test, and rpm-build
|
||||
RUN set -ex && yum -y install rpm-build rpmdevtools
|
||||
|
||||
ARG mscpdir="/mscp-@MSCP_VERSION@"
|
||||
ARG mscptgz="mscp-@MSCP_VERSION@.tar.gz"
|
||||
|
||||
COPY . ${mscpdir}
|
||||
|
||||
# install build dependency
|
||||
RUN ${mscpdir}/scripts/install-build-deps.sh
|
||||
|
||||
# prepare rpmbuild
|
||||
RUN rpmdev-setuptree \
|
||||
&& rm -rf ${mscpdir}/build \
|
||||
&& tar zcvf /${mscptgz} --exclude-vcs ${mscpdir} \
|
||||
&& cp /${mscptgz} ~/rpmbuild/SOURCES/ \
|
||||
&& cp ${mscpdir}/rpm/mscp.spec ~/rpmbuild/SPECS/
|
||||
|
||||
# build rpm and src.rpm
|
||||
RUN rpmbuild -ba ~/rpmbuild/SPECS/mscp.spec
|
||||
Reference in New Issue
Block a user