mockbuild: allow inserting an extra path segment
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 <ondrej@budai.cz>
This commit is contained in:
parent
df74343eb8
commit
5fd2ad2337
2 changed files with 14 additions and 2 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue