Test RPM build and install for regressions

On Fedora and now Centos (added), we build RPMs based on the spec in
contrib/spec to make sure we protect against regressions when creating
RPMs.  Once the RPM is built, we then test actually installing the RPM
to ensure that no deps are missing for install.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1356
Approved by: rhatdan
This commit is contained in:
baude 2018-08-27 15:06:22 -05:00 committed by Atomic Bot
parent c33b359ed1
commit 9e315518aa
4 changed files with 63 additions and 20 deletions

View File

@ -8,7 +8,7 @@ fi
git fetch --unshallow || : git fetch --unshallow || :
COMMIT=$(git rev-parse HEAD) COMMIT=$(git rev-parse HEAD)
COMMIT_SHORT=$(git rev-parse --short HEAD) COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
COMMIT_NUM=$(git rev-list HEAD --count) COMMIT_NUM=$(git rev-list HEAD --count)
COMMIT_DATE=$(date +%s) COMMIT_DATE=$(date +%s)

View File

@ -73,4 +73,13 @@ container:
tests: tests:
- sh contrib/build_rpm.sh - sh contrib/build_rpm.sh
required: true required: true
context: "RPM regressions" context: "Fedora RPM regressions"
---
container:
image: registry.centos.org/centos:7
tests:
- sh contrib/build_rpm.sh
required: true
context: "CentOS RPM regressions"

View File

@ -1,23 +1,57 @@
#!/bin/bash #!/bin/bash
set -x set -x
dnf -y install device-mapper-devel \
git \ pkg_manager=`command -v dnf`
glib2-devel \ if [ -z "$pkg_manager" ]; then
glibc-static \ pkg_manager=`command -v yum`
golang \ fi
golang-github-cpuguy83-go-md2man \
gpgme-devel \ echo "Package manager binary: $pkg_manager"
libassuan-devel \
libseccomp-devel \
libselinux-devel \ if [ $pkg_manager == "/usr/bin/yum" ]; then
make \ echo "[virt7-container-common-candidate]
ostree-devel \ name=virt7-container-common-candidate
golang-github-cpuguy83-go-md2man \ baseurl=https://cbs.centos.org/repos/virt7-container-common-candidate/x86_64/os/
rpm-build \ enabled=1
btrfs-progs-devel \ gpgcheck=0" > /etc/yum.repos.d/container_virt.repo
python3-devel \ fi
declare -a PKGS=(device-mapper-devel \
git \
glib2-devel \
glibc-static \
golang \
golang-github-cpuguy83-go-md2man \
gpgme-devel \
libassuan-devel \
libseccomp-devel \
libselinux-devel \
make \
ostree-devel \
golang-github-cpuguy83-go-md2man \
rpm-build \
btrfs-progs-devel \
go-compilers-golang-compiler \
)
if [ $pkg_manager == "/usr/bin/dnf" ]; then
PKGS+=(python3-devel \
python3-varlink \ python3-varlink \
go-compilers-golang-compiler )
fi
echo ${PKGS[*]}
$pkg_manager install -y ${PKGS[*]}
make -f .copr/Makefile make -f .copr/Makefile
rpmbuild --rebuild podman-*.src.rpm rpmbuild --rebuild podman-*.src.rpm
# Test to make sure the install of the binary works
$pkg_manager -y install ~/rpmbuild/RPMS/x86_64/podman-*.x86_64.rpm
# If we built python/varlink packages, we should test their installs too
if [ $pkg_manager == "/usr/bin/dnf" ]; then
$pkg_manager -y install ~/rpmbuild/RPMS/noarch/python*
fi

View File

@ -61,7 +61,7 @@ BuildRequires: pkgconfig
BuildRequires: make BuildRequires: make
Requires: runc Requires: runc
Requires: skopeo-containers Requires: skopeo-containers
Requires: containernetworking-cni >= 0.6.0-3 Requires: containernetworking-plugins >= 0.6.0-3
Requires: iptables Requires: iptables
Requires: oci-systemd-hook Requires: oci-systemd-hook
%if 0%{?rhel} <= 7 %if 0%{?rhel} <= 7