2019-04-12 18:17:28 +00:00
|
|
|
#!/bin/sh -eux
|
|
|
|
|
|
|
|
SRPM="$1"
|
|
|
|
|
2019-11-21 09:10:57 +00:00
|
|
|
# always remove older versions of these RPMs if they exist
|
|
|
|
# to ensure newly built packages have been installed
|
|
|
|
yum -y remove lorax lorax-composer composer-cli
|
|
|
|
|
2019-05-22 14:42:03 +00:00
|
|
|
if ! rpm -q beakerlib; then
|
|
|
|
if [ $(. /etc/os-release && echo $ID) = "rhel" ]; then
|
|
|
|
(cd /etc/yum.repos.d; curl -O -L http://download.devel.redhat.com/beakerrepos/beaker-client-RedHatEnterpriseLinux.repo)
|
|
|
|
|
|
|
|
# The beaker repository doesn't include repos for minor releases
|
|
|
|
VERSION=$(. /etc/os-release && echo ${VERSION_ID%.*})
|
|
|
|
yum install -y --releasever=$VERSION --setopt=sslverify=0 beakerlib
|
|
|
|
|
|
|
|
# prevent yum from trying to sync the cache again later (it fails without sslverify=0)
|
|
|
|
rm /etc/yum.repos.d/beaker-client-RedHatEnterpriseLinux.repo
|
|
|
|
else
|
|
|
|
yum install -y beakerlib
|
|
|
|
fi
|
2019-05-21 17:54:18 +00:00
|
|
|
fi
|
|
|
|
|
2019-10-28 09:14:57 +00:00
|
|
|
# disable mirrors & re-enable direct download
|
|
|
|
sed -i "s/metalink.*//" /etc/yum.repos.d/*.repo
|
|
|
|
sed -i "s/#\(baseurl=.*\)/\1/" /etc/yum.repos.d/*.repo
|
|
|
|
sed -i "s/download.fedoraproject/dl.fedoraproject/" /etc/yum.repos.d/*.repo
|
|
|
|
|
2019-04-12 18:17:28 +00:00
|
|
|
# Grow root partition to make room for images. This only works on Fedora right now.
|
|
|
|
echo ", +" | sfdisk -N 2 -f /dev/vda
|
|
|
|
partprobe
|
2019-05-21 15:43:32 +00:00
|
|
|
pvs --noheadings -opv_name | xargs pvresize
|
|
|
|
rootlv=$(findmnt --noheadings -oSOURCE /)
|
|
|
|
lvresize $rootlv -l+100%FREE -r
|
2019-04-12 18:17:28 +00:00
|
|
|
|
2019-05-21 15:17:15 +00:00
|
|
|
rm -rf build-results
|
2019-10-11 22:19:42 +00:00
|
|
|
su builder -c "/usr/bin/mock --verbose --no-clean --resultdir build-results --rebuild $SRPM"
|
2019-04-12 18:17:28 +00:00
|
|
|
|
|
|
|
packages=$(find build-results -name '*.rpm' -not -name '*.src.rpm')
|
2019-05-21 17:54:18 +00:00
|
|
|
yum install -y $packages
|
2019-04-12 18:17:28 +00:00
|
|
|
|
|
|
|
systemctl enable lorax-composer.socket
|
2019-10-23 23:44:15 +00:00
|
|
|
|
|
|
|
if [ -f /usr/bin/docker ]; then
|
|
|
|
yum remove -y $(rpm -qf /usr/bin/docker)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! rpm -q podman-docker; then
|
|
|
|
yum install -y podman-docker
|
|
|
|
fi
|