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

rpmrepo-snapshot: support building the snapshots-cache #75

Merged
merged 1 commit into from
Jul 4, 2024
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
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
Loading