Skip to content

Commit

Permalink
Allow yumrepo to deploy from stagingyum
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Sep 5, 2023
1 parent c015e8d commit 377567b
Showing 1 changed file with 13 additions and 4 deletions.
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/"
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

0 comments on commit 377567b

Please sign in to comment.