Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow yumrepo to deploy from stagingyum #1875

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions puppet/modules/web/files/deploy-yumrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ do_rsync() {
fi

rsync "${opts[@]}" --log-file-format 'CHANGED %f' "${REPO_SOURCE_RPM}/*" "${REPO_INSTANCE_PATH}/"
rsync "${opts[@]}" --log-file-format 'CHANGED source/%f' "${REPO_SOURCE_SRPM}/" "${REPO_INSTANCE_PATH}/source/"

if [[ -n "$REPO_SOURCE_SRPM" ]]; then
rsync "${opts[@]}" --log-file-format 'CHANGED source/%f' "${REPO_SOURCE_SRPM}/" "${REPO_INSTANCE_PATH}/source/"
fi

set +f
for d in "${REPO_INSTANCE_PATH}"/*; do
Expand Down Expand Up @@ -93,15 +96,21 @@ REPO_SOURCE=$1
REPO_DEST=$2
OVERWRITE=${3:-false}
MERGE=${4:-false}
STAGING=${5:-false}

if [[ -z $REPO_SOURCE ]] || [[ -z $REPO_DEST ]] ; then
echo "Usage: $0 REPO_SOURCE REPO_DEST OVERWRITE MERGE"
exit 1
fi

REPO_SOURCE_BASE="rsync://koji.katello.org/releases"
REPO_SOURCE_RPM="${REPO_SOURCE_BASE}/yum/${REPO_SOURCE}"
REPO_SOURCE_SRPM="${REPO_SOURCE_BASE}/source/${REPO_SOURCE}"
if [[ $STAGING == true ]] ; then
REPO_SOURCE_BASE="rsync://rsync.theforeman.org/stagingyum/"
ehelms marked this conversation as resolved.
Show resolved Hide resolved
REPO_SOURCE_RPM="${REPO_SOURCE_BASE}/${REPO_SOURCE}"
else
REPO_SOURCE_BASE="rsync://koji.katello.org/releases"
REPO_SOURCE_RPM="${REPO_SOURCE_BASE}/yum/${REPO_SOURCE}"
REPO_SOURCE_SRPM="${REPO_SOURCE_BASE}/source/${REPO_SOURCE}"
fi

DEPLOY_TO="/var/www/vhosts/yum/htdocs"
REPO_PATH="${DEPLOY_TO}/${REPO_DEST}"
Expand Down