From 4f34f205a6ed50abce0ee458dd4bdba00fb64b06 Mon Sep 17 00:00:00 2001 From: James Molet Date: Thu, 20 Jun 2024 10:46:00 -0400 Subject: [PATCH] feat(test): Adding script to install from copr/packit build for downstream PR jobs --- systemtest/copr-setup.sh | 24 ++++++++++++++++++++++++ systemtest/tests/integration/test.sh | 4 ++++ 2 files changed, 28 insertions(+) create mode 100755 systemtest/copr-setup.sh diff --git a/systemtest/copr-setup.sh b/systemtest/copr-setup.sh new file mode 100755 index 0000000..de435b9 --- /dev/null +++ b/systemtest/copr-setup.sh @@ -0,0 +1,24 @@ +#!/usr/bin/bash -eux +dnf install -y dnf-plugins-core + +#Determine the repo needed from copr +#Available repositories: 'centos-stream-8-x86_64', 'rhel-8-x86_64', +# 'centos-stream-9-x86_64', 'rhel-9-x86_64', 'fedora-40-x86_64', +# 'fedora-39-x86_64', 'fedora-rawhide-x86_64' +source /etc/os-release +if [ "$ID" == "centos" ]; then + ID='centos-stream' +fi +VERSION_MAJOR=$(echo ${VERSION_ID} | cut -d '.' -f 1) +COPR_REPO="${ID}-${VERSION_MAJOR}-$(uname -m)" + +#get yggdrasil +curl https://copr.fedorainfracloud.org/coprs/g/yggdrasil/latest/repo/$ID-$VERSION_MAJOR/group_yggdrasil-latest-$ID-$VERSION_MAJOR.repo \ + -o /etc/yum.repos.d/yggdrasil.repo + +dnf install -y yggdrasil yggdrasil-worker-package-manager --disablerepo=* --enablerepo=*yggdrasil* + +# These PR packit builds have an older version number for some reason than the released... +dnf remove -y rhc +dnf copr -y enable packit/RedHatInsights-rhc-${ghprbPullId} ${COPR_REPO} +dnf install -y rhc --disablerepo=* --enablerepo=*rhc* diff --git a/systemtest/tests/integration/test.sh b/systemtest/tests/integration/test.sh index 65859c3..62a1f97 100755 --- a/systemtest/tests/integration/test.sh +++ b/systemtest/tests/integration/test.sh @@ -5,6 +5,10 @@ set -x # get to project root cd ../../../ +# Check for GitHub pull request ID and install build if needed. +# This is for the downstream PR jobs. +[ -z "${ghprbPullId+x}" ] || ./systemtest/copr-setup.sh + dnf --setopt install_weak_deps=False install -y \ podman git-core python3-pip python3-pytest logrotate