loci/scripts/cleanup.sh
Mohammed Naser 9e7b71c304 Reduce build targets
OpenSUSE LEAP is currently not in use by any known downstream
users and it has been broken for quite sometime, leaving the gate
in a broken state and unable to land any code.  There's no active
maintainer for it as well.

Debian support was added by us (VEXXHOST) but we decided that
we're not going to continue using it and move towards Ubuntu, so
we do not want to maintain it, as well as that it is building images
for Train only.

It also updates the README file accordingly as well as includes
focal in there which has been recently added.

Change-Id: Ideb497c169828184d301b6be4359a7c2228aa444
2022-05-23 15:59:49 +00:00

36 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -ex
case ${distro} in
ubuntu)
apt-get purge -y --auto-remove \
git \
patch \
python3-virtualenv \
virtualenv
rm -rf /var/lib/apt/lists/*
;;
centos)
# We should be removing 'patch' here, but that breaks
# centos as it tries to rip out systemd for some reason
yum -y autoremove \
git \
python-virtualenv \
python3-virtualenv
yum clean all
;;
*)
echo "Unknown distro: ${distro}"
exit 1
;;
esac
# Changing this option allows python to use libraries outside of the
# virtualenv > 20 if they do not exist inside the venv. This is a requirement
# for using python-rbd which is not pip installable and is only available
# in packaged form.
sed -i 's/\(include-system-site-packages\).*/\1 = true/g' /var/lib/openstack/pyvenv.cfg
rm -rf /tmp/* /root/.cache /etc/machine-id
find /usr/ /var/ \( -name "*.pyc" -o -name "__pycache__" \) -delete