From b31f61649a60cd91b5e37a8d2bf66da328d7b4fd Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Tue, 18 Jan 2022 13:22:07 +0200 Subject: [PATCH] ci: Overwrite REPO_PATH based on the value of $NIGHTLY Override only for osbuild-composer, not other projects will produce different repositories/rpms for the same commit when executed from a PR and from the scheduled pipelines. We need the distinction b/c osbuild-composer-tests RPMs end up slightly different in these two cases. For more info see: https://github.com/osbuild/osbuild-composer/pull/2093#pullrequestreview-854328838 https://github.com/osbuild/osbuild-composer/pull/2093#issuecomment-1014469915 --- schutzbot/deploy.sh | 8 +++++++- schutzbot/mockbuild.sh | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 815f1e68a..5fc98d544 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -39,11 +39,17 @@ function setup_repo { local project=$1 local commit=$2 local priority=${3:-10} + + local REPO_PATH=${project}/${DISTRO_VERSION}/${ARCH}/${commit} + if [[ "${NIGHTLY:=false}" == "true" && "${project}" == "osbuild-composer" ]]; then + REPO_PATH=nightly/${REPO_PATH} + fi + greenprint "Setting up dnf repository for ${project} ${commit}" sudo tee "/etc/yum.repos.d/${project}.repo" << EOF [${project}] name=${project} ${commit} -baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/${project}/${DISTRO_VERSION}/${ARCH}/${commit} +baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/${REPO_PATH} enabled=1 gpgcheck=0 priority=${priority} diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index a7f35e8b4..eba6d4ba6 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -38,6 +38,9 @@ fi # Relative path of the repository – used for constructing both the local and # remote paths below, so that they're consistent. REPO_PATH=osbuild-composer/${DISTRO_VERSION}/${ARCH}/${COMMIT} +if [ "${NIGHTLY:=false}" == "true" ]; then + REPO_PATH=nightly/${REPO_PATH} +fi # Directory to hold the RPMs temporarily before we upload them. REPO_DIR=repo/${REPO_PATH}