2019-04-12 18:17:28 +00:00
|
|
|
#!/bin/sh -eux
|
|
|
|
|
|
|
|
SRPM="$1"
|
|
|
|
|
2019-05-21 17:54:18 +00:00
|
|
|
if ! rpm -q beakerlib && [ $(. /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
|
|
|
|
fi
|
|
|
|
|
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-04-12 18:17:28 +00:00
|
|
|
su builder -c "/usr/bin/mock --no-clean --resultdir build-results --rebuild $SRPM"
|
|
|
|
|
|
|
|
packages=$(find build-results -name '*.rpm' -not -name '*.src.rpm')
|
2019-05-21 15:17:15 +00:00
|
|
|
rpm -e --verbose $(basename -a ${packages[@]} | sed 's/-[0-9].*.rpm$//') || true
|
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
|
|
|
|
systemctl enable docker.service
|