From 5fd2ad23370f937a4cae65af9a6cb9c4e9c98fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Fri, 26 Mar 2021 07:41:06 +0100 Subject: [PATCH] mockbuild: allow inserting an extra path segment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitLab CI builds its own rpms and thus it must be use a different path. This commit modifies mockbuild.sh and deploy.sh to be able to add an extra path segment into the path so GitLab can use a different path. Signed-off-by: Ondřej Budai --- schutzbot/deploy.sh | 10 +++++++++- schutzbot/mockbuild.sh | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index fd7e2af0c..c309a70f3 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -35,11 +35,19 @@ function setup_repo { local project=$1 local commit=$2 local priority=${3:-10} + + local extra_repo_path_segment="" + if [[ "$project" == "osbuild-composer" ]]; then + # Used in the gitlab CI proof of concept so it can upload its rpms to + # a different location. + extra_repo_path_segment="${EXTRA_REPO_PATH_SEGMENT:-}" + 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}/${ID}-${VERSION_ID}/${ARCH}/${commit} +baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/${extra_repo_path_segment}${project}/${ID}-${VERSION_ID}/${ARCH}/${commit} enabled=1 gpgcheck=0 priority=${priority} diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 0fac72823..276f7e482 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -26,9 +26,13 @@ REPO_BUCKET=osbuild-composer-repos # Public URL for the S3 bucket with our artifacts. MOCK_REPO_BASE_URL="http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com" +# Used in the gitlab CI proof of concept so it can upload its rpms to +# a different location. +EXTRA_REPO_PATH_SEGMENT="${EXTRA_REPO_PATH_SEGMENT:-}" + # Relative path of the repository – used for constructing both the local and # remote paths below, so that they're consistent. -REPO_PATH=osbuild-composer/${ID}-${VERSION_ID}/${ARCH}/${COMMIT} +REPO_PATH=${EXTRA_REPO_PATH_SEGMENT}osbuild-composer/${ID}-${VERSION_ID}/${ARCH}/${COMMIT} # Directory to hold the RPMs temporarily before we upload them. REPO_DIR=repo/${REPO_PATH}