Skip to content

Commit

Permalink
rpmrepo-snapshot: support building the snapshots-cache
Browse files Browse the repository at this point in the history
This cache can be used by the enumerate handler.
  • Loading branch information
croissanne committed Jul 3, 2024
1 parent 1a65beb commit 565e62c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scripts/rpmrepo-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,20 @@ git reset --hard "${RPMREPO_COMMIT}"
# Select the specified target. In case an explicit target is specified, just
# verify the target configuration exists. If automatic selection is required,
# list all targets, sort them, and then index them by the requested job index.
# Note that "snapshots-cache" just builds the list of available repository
# snapshots and exits, this cache is then used by the enumerate handler.
#

echo "Selecting target: ${RPMREPO_TARGET}"

TARGET_PATH=""
if [[ $RPMREPO_TARGET = "auto" ]] ; then
if [[ $RPMREPO_TARGET = "snapshots-cache" ]]; then
python3 -m "src.ctl" \
--cache "/var/lib/rpmrepo/cache" \
--local "batch" \
snapshots-cache
exit 0
elif [[ $RPMREPO_TARGET = "auto" ]] ; then
TARGET_LIST=($(ls ./repo | sort))
if (( ${AWS_BATCH_JOB_ARRAY_INDEX} >= ${#TARGET_LIST[@]} )) ; then
echo >&2 "WARNING: job index exceeds target list size, nothing to do"
Expand Down

0 comments on commit 565e62c

Please sign in to comment.