Skip to content

Instantly share code, notes, and snippets.

@TJM
Created June 30, 2020 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TJM/730dea196c7fc43aec2b23ded3569793 to your computer and use it in GitHub Desktop.
Save TJM/730dea196c7fc43aec2b23ded3569793 to your computer and use it in GitHub Desktop.
Sync all repos (or a list of repos) in pulp
#!/bin/bash -e
if [ $# -gt 0 ]; then
REPOS=$*
else
REPOS=$(pulp-admin repo list | awk '/Id:/ {print $NF}')
fi
for repo in $REPOS
do
echo $repo
pulp-admin rpm repo sync run --repo-id $repo
pulp-admin rpm repo publish run --repo-id $repo
done
## Workaround
#pulp-admin rpm repo remove rpm --repo-id CentOS-7-x86_64-epel --str-eq='name=python-django-compressor'
#pulp-admin rpm repo publish run --repo-id CentOS-7-x86_64-epel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment