Created
December 18, 2016 18:06
-
-
Save nvgoldin/c7c20acc73de85c9a0a2690ffe260da2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
SUITE=$1 | |
JENKINS="/home/ngoldin/src/gerrit.ovirt.org/jenkins" | |
LAGO="/home/ngoldin/src/nvgoldin.github.com/lago" | |
REPODIR="/tmp/lago-export" | |
OST="/home/ngoldin/src/gerrit.ovirt.org/ovirt-system-tests" | |
BUILD_CONF="/home/ngoldin/src/nvgoldin.github.com/lago-build-scripts" | |
echo "BUILDING LAGO RPM" | |
pushd "$LAGO" | |
sudo git clean -fdx | |
"$JENKINS/mock_configs/mock_runner.sh" --mock-confs-dir "$BUILD_CONF" --build-only el7 | |
popd | |
rm -rf "$REPODIR" | |
mkdir -p "$REPODIR/el7/noarch" | |
echo "CURRENT DATE: $(date)" | |
find "$LAGO/exported-artifacts/" -name '*.rpm' -type f -exec rpm -qip {} \; | grep -i 'Build date' | |
find "$LAGO/exported-artifacts/" -name '*.rpm' -type f -exec cp -v {} "$REPODIR/el7/noarch/" \; | |
echo "CREATEREPO" | |
pushd $REPODIR | |
createrepo el7 | |
popd | |
pushd $OST/automation | |
sed -i '/lago,/c\lago,file:\/\/\/tmp\/lago-export\/el7' ./*.repos | |
yum_cmd='yum install -y lago lago-ovirt' | |
if ! grep "$yum_cmd" suite.sh; then | |
sed -i "2i $yum_cmd" suite.sh | |
fi | |
for mount in *.mounts; do | |
if ! grep "$REPODIR" "$mount"; then | |
echo "$REPODIR" >> "$mount" | |
fi | |
if ! grep "/dev/shm" "$mount"; then | |
echo "/dev/shm" >> "$mount" | |
fi | |
done | |
sed -i '/lago/d' ./*.packages | |
for package in *.packages; do | |
if ! grep -e "^yum$" "$package"; then | |
echo "yum" >> "$package" | |
fi | |
if ! grep -e "^yum-utils$" "$package"; then | |
echo "yum-utils" >> "$package" | |
fi | |
done | |
sed -n '2p' suite.sh | |
popd | |
sudo su -c "find /var/lib/mock -name '*lago*' | xargs rm -fvr" | |
sudo su -c "find /var/cache/mock -name '*lago*' | xargs rm -fvr" | |
#~/src/gerrit.ovirt.org/jenkins/mock_configs/mock_runner.sh --mock-confs-dir ~/src/gerrit.ovirt.org/jenkins/mock_configs/ -e automation/basic_suite_4.0.sh el7 | |
cmd="$JENKINS/mock_configs/mock_runner.sh --mock-confs-dir BUILD_CONF -e automation/$SUITE.sh el7" | |
if [ -z "$SUITE" ]; then | |
echo "$cmd" | |
else | |
pushd $OST | |
echo "running:" | |
echo "$JENKINS/mock_configs/mock_runner.sh --mock-confs-dir $BUILD_CONF -e "automation/$SUITE.sh" el7" | |
$JENKINS/mock_configs/mock_runner.sh --mock-confs-dir $BUILD_CONF -e "automation/$SUITE.sh" el7 | |
popd | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment