From a1b730d536b657f591cf2af3cb8680290bb70e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 3 Dec 2020 11:59:39 +0100 Subject: [PATCH] tests: pre-install EPEL for koji-osbuild rev dep test on RHEL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit koji-osbuild-tests depends on koji which is not available in RHEL. As we need to get rid of EPEL from deploy.sh (see the following commit), we need a mechanism to preinstall EPEL before koji-osbuild-tests is installed. This commit introduces pre_install_packages to Schutzfile - a simple way to install packages before ${PROJECT}-tests is installed. Signed-off-by: Ondřej Budai --- Schutzfile | 5 ++++- schutzbot/deploy.sh | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Schutzfile b/Schutzfile index 023ad6786..08d6581a2 100644 --- a/Schutzfile +++ b/Schutzfile @@ -14,7 +14,10 @@ }, "dependants": { "koji-osbuild": { - "commit": "4fdc457745e1147475ea3ac1e3b073e592d7b174" + "commit": "4fdc457745e1147475ea3ac1e3b073e592d7b174", + "pre_install_packages": [ + "https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm" + ] } } } diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 143031d70..c116b8e92 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -75,6 +75,15 @@ fi if [[ "$PROJECT" != "osbuild-composer" ]]; then PROJECT_COMMIT=$(jq -r ".[\"${ID}-${VERSION_ID}\"].dependants[\"${PROJECT}\"].commit" Schutzfile) setup_repo "${PROJECT}" "${PROJECT_COMMIT}" 10 + + # Get a list of packages needed to be preinstalled before "${PROJECT}-tests". + # Useful mainly for EPEL. + PRE_INSTALL_PACKAGES=$(jq -r ".[\"${ID}-${VERSION_ID}\"].dependants[\"${PROJECT}\"].pre_install_packages[]?" Schutzfile) + + if [ "${PRE_INSTALL_PACKAGES}" ]; then + # shellcheck disable=SC2086 # We need to pass multiple arguments here. + sudo dnf -y install ${PRE_INSTALL_PACKAGES} + fi fi if [[ $ID == rhel ]]; then